Page 1 of 1

Bbcode cardimg tag working funny

Posted: Sun May 16, 2021 1:52 am
by darrenhabib
Something has changed to the cardimg tag in that when you specify a width the height the image takes up is still the same as not setting a width.



It looks like it's just centered aligned, but if you hover over the card image tag on the left you'll see that you can click on the link on the card above and below where the actual image is.
My primers are very messed up with this change..

Re: Bbcode cardimg tag working funny

Posted: Sun May 16, 2021 2:00 am
by Feyd_Ruin
I'm honestly wondering if there weren't a bunch of browser updates, as things seem to be different when I haven't changed them.
I've removed the "object-fit" property from post images. As to how it changed its function between when I added it a year and a half ago and now, though........

Re: Bbcode cardimg tag working funny

Posted: Sun May 16, 2021 2:20 am
by darrenhabib
If a thread hasn't been resubmitted then the changes don't take effect, so not sure if that gives you any more information to go by.
If you look at the Will & Rowan thread it's all been effected by the change (search for "Mass creature removal" to see images effected).
But my Aminatou hasn't been updated recently as seems to be unaffected.

I feel this has happened in the last week or even the last few days because I was working on the Kenrith one maybe 4 days ago and I'm pretty sure it was fine then.
The browser change thing does seem like it would coincide with this.

Re: Bbcode cardimg tag working funny

Posted: Sun May 16, 2021 2:30 am
by darrenhabib
Actually I looked at the html between working and not working examples and you can see a set height of 405px is set no matter what the width is.
As you can see when it was working it just set it to autopx.


HTML when working
<img class="autocard_image" style="width:160px;height:autopx;border-radius:12px;box-shadow:0px 0px 0px rgba(0,0,0,0.5);object-fit:fill" src="https://www.mtgnexus.com/autocard/img/The+Chain+Veil">

New HTML no working
<img class="autocard_image" style="width:160px;height:405px;border-radius:12px;box-shadow:0px 0px 0px rgba(0,0,0,0.5);object-fit:fill" src="https://www.mtgnexus.com/autocard/img/Chandra%2C+Novice+Pyromancer">

Re: Bbcode cardimg tag working funny

Posted: Sun May 16, 2021 2:37 am
by Feyd_Ruin
Ohhhh, I misunderstood part of your issue.

Aye, that "height:autopx;" always bugged me, since it's malformed. It ignored it and assumed auto, but still. I fixed this by giving it a default height of 405px, but that means it assumed you'd set a height AND width if you did either. When you didn't, the default came into play. (Posts are rendered live, BUT the tag is saved with whatever default values I give it when you submit. So the posts simply have different default values since they changed - one at 405, one at "auto".)

I adjusted the way it is again, so it now works with auto or pixel, with an "auto" as the default. This makes it's compatible with only setting a width or height.

The caveat is that you'll need to re-edit the messed up posts because they'll still have the old default 405 saved, and editing and resaving will allow them to inherit the new "auto".

edit:
I edited and saved the Kenriths primer to confirm it's a no-touch fix, and it updated correctly.
Apologies for the trouble.