News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Strange behaviour when resizing img

Started by FragaCampos, June 09, 2020, 03:29:40 PM

Previous topic - Next topic

FragaCampos

Hi there.

When resizing an image inside img tag I always used the width and the resizing was done automatically to keep the image proportions without the height portion.
But recently, this changed, and now, everytime I use width=*, SMF always adds the height=*. Why did this happen? Was it a change in the server or because I updated the forum to 2.0.17?

Deaks

do you have any mods installed that deal with posts bbc or images?
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

Mick.

I suppose you could look at both versions and see if bbc_img in the css file changed?

FragaCampos

This just happened after updating from 2.0.15 to 2.017 and I also installed the updated version of nCode Image Resizer. But I uninstalled the mod and the issue persists.

The other thing I did after updating SMF was this:
https://www.simplemachines.org/community/index.php?topic=571082.msg4042818#msg4042818



Quote from: Mick. on June 09, 2020, 03:57:59 PM
I suppose you could look at both versions and see if bbc_img in the css file changed?

If you mean index.css, both versions are the same, they weren't changed.

.bbc_img
{
border: 0;
}

FragaCampos

OK, I found the problem.

This happened when I activated Configuration  -> Layout -> Max width of posted pictures (0 = disable)


Two things:
- I can't understand why this feature doesn't state anywhere that it only affects *new* posted images. It's pretty useless as it is.
- I can't understand why SMF doesn't have a functional feature to resize images in posts. Instead, we have to rely in mods that are scarcely maintained.

Also, and forgive me to put this here, I miss the old days when something so simple as this would have had a quick and straightforward answer.

Regards.

Arantor

Quote- I can't understand why this feature doesn't state anywhere that it only affects *new* posted images. It's pretty useless as it is.

Because at the time the code was written 10+ years ago, max-width/max-height didn't exist in CSS, and you wouldn't want the forum to have to go look up the size of an image every single time to work out if it was too big or not, it's only done at post time, rather than in every single thread. (CSS has no such restrictions, but SMF 2.0 doesn't get feature changes, only security fixes)

Quote- I can't understand why SMF doesn't have a functional feature to resize images in posts.

It does, you've been using it. I don't know why it changed as you describe, it worked the way you describe beforehand.

But then again I always encouraged people to put things in galleries rather than in threads.

FragaCampos

Sorry, Arantor, but how is this functional if it doesn't resize images posted before activating this option in the admin panel?


Quote from: Arantor on June 11, 2020, 05:09:57 PM
It does, you've been using it. I don't know why it changed as you describe, it worked the way you describe beforehand.

Kindred

How is it supposed to do that, since it is a real-time trigger that only runs on upload?

It does exactly what is says, and what we intended, just not what you think it should do....
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

Quote from: FragaCampos on June 11, 2020, 10:12:55 PM
Sorry, Arantor, but how is this functional if it doesn't resize images posted before activating this option in the admin panel?


Quote from: Arantor on June 11, 2020, 05:09:57 PM
It does, you've been using it. I don't know why it changed as you describe, it worked the way you describe beforehand.

As I said, it runs at the time of posting because when it was written there was literally no other way to find the image size to work out if the image was too large or not and then resize it. Things have changed, but a piece of software in mostly security-only mode doesn't change things like this in it.

FragaCampos

It does not. It doesn't even tell users that it only resizes images after posted. Nowhere it says that it's a realtime trigger, not even in SMF's documentation. That should be clearly stated.
Note that I don't upload images. 99,9% of images in my forum are hosted elsewhere. So, please don't tell this is functional. First, because it doesn't inform correctly, and secondly because it doesn't resize all images posted in a forum.

From what Arantor said, I understand that there was no way to make it otherwise back in the past, but that's not really a good argument, since many things also changed in the last years and SMF adapted to them. nCode Image resizer exists since 2008. That's 12 years. Shouldn't SMF have something similar at its core after all this time? Every SMF update I dread that I have to ask in an almost dead mods sections again and again to update this mod. This time, from 2.0.15 to 2.0.17, there are issues again and I'll have to pay someone to fix it. This is tiring and disappointing and much of what you read here just stems from that frustration.

I want to clearly state I'm not complaining. I know everyone does what's possible given the time and will to do this kind of work, but it's also my task as an old SMF user to push things that I think could and should be standard and well developed.




Quote from: Kindred on June 11, 2020, 11:45:40 PM
How is it supposed to do that, since it is a real-time trigger that only runs on upload?

It does exactly what is says, and what we intended, just not what you think it should do....

Arantor

QuoteShouldn't SMF have something similar at its core after all this time?

Not for a software whose policy is that patches are primarily security fixes only.

I _think_ this is better in 2.1 but I'm not sure. It certainly is possible *now* to make it better. It wasn't when that stuff was first written 15 years ago...

Advertisement: