Thumbnail resizing

  • Andrey
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 2 weeks ago #79634 by Andrey
Thumbnail resizing was created by Andrey
Hi,
Is it possible to resize uploaded thumbnail by width, not by height?
For example: I set width=292 and height=180 in "Configuration", and if I upload square picture, it becomes 180x180, but I want 292x292.
Is it possible to setup without hacking the code?

Please Log in or Create an account to join the conversation.

More
8 years 2 weeks ago #79655 by Brian F
Replied by Brian F on topic Thumbnail resizing
Hi Andrey, would putting "auto" in the height field do what you need it to do?

Please Log in or Create an account to join the conversation.

More
8 years 2 weeks ago #79674 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Thumbnail resizing
Hi Andrey

I will have to check the code again but I think you will need to customize the code. Will look at the code to see whether we can improve the code to make it works better. Will get back to you later today or on tomorrow

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • Andrey
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 2 weeks ago #79751 by Andrey
Replied by Andrey on topic Thumbnail resizing

Brian F wrote: Hi Andrey, would putting "auto" in the height field do what you need it to do?

Brian, I don't think so – these are not css values, these fields values go straight to php imagecopyresized() function in the helper file. The function takes integer values.

Please Log in or Create an account to join the conversation.

More
8 years 2 weeks ago #79800 by Brian F
Replied by Brian F on topic Thumbnail resizing
Andrey, you're correct, I do see that now. I did test it however and it works, but tested it again and see that any alpha characters work, such as I tried "null" and it sized down the photo by width only and kept the height in proportion. Tuan however should have better solution with his code adjustment.

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc