Announcement

#1 2018-12-17 14:04:00

kinmen
Member
2018-12-17
14

pictures' max width

Hello,
I successfully migrated to Piwigo from Flickr. Before, many of my pictures were linked to another web site of mine, to be included inside articles. In that way my articles have a proper layout, where the size of the included pictures was established at the moment of writing a post.

Now I'm facing a problem by re-linking the pictures form Piwigo instead of Flickr: the size of Flickr's pictures was based on the width, while Piwigo seems to consider the max length of the shortest dimension when resizing.
For example, if I set an XS 320x210 because I need the pic to be 320px in width, the generated image  is instead resized at 280x210

I've already deleted all the default sizes from the cache and recreated them, but this issue is driving me mad because it's messing the layout of my articles. Isn't there a way to fix only the width of the generated images instead of providing also the height, also considering that many of my pictures' length and width aren't those canonical of a camera?

Thank you so much

Piwigo version: 2.9+plugin automatic size
PHP version: 7.1 with Imagemagick

Offline

 

#2 2018-12-17 22:44:35

executive
Member
2017-08-16
484

Re: pictures' max width

kinmen wrote:

For example, if I set an XS 320x210 because I need the pic to be 320px in width, the generated image  is instead resized at 280x210

Did you try entering 320x320?

You could also start with a larger size, and then use HTML for exact sizing in your article.

Offline

 

#3 2018-12-18 12:55:35

kinmen
Member
2018-12-17
14

Re: pictures' max width

It's weird... I've set the size to 320x320, deleted the cache of the old sizes, used the batch to regenerate the images, but those are still 320x240...??? Well, at least the size of the width is right now... But still I don't understand the behavior of the resizing process.

By the way, styling the images with html inside the articles would require a lot of additional work, because images' style only applies to pictures inside the FS of the (other) server.

Last edited by kinmen (2018-12-18 13:01:20)

Offline

 

#4 2018-12-18 19:41:32

executive
Member
2017-08-16
484

Re: pictures' max width

I'm confused.

kinmen wrote:

I've set the size to 320x320...  but those are still 320x240...???

I thought that's what you wanted? A width of 320px.


Like the box says, you are specifying the MAXIMUM dimensions. The image will be resized so that both the width AND the height do not exceed the sizes you indicate. There's nothing weird about it.

Offline

 

#5 2018-12-18 19:46:37

executive
Member
2017-08-16
484

Re: pictures' max width

kinmen wrote:

For example, if I set an XS 320x210... the generated image  is instead resized at 280x210

It sounds like your image has proportions of 1.3:1
You cannot make it 320x210 because that is a proportion of 1.5:1
It would be stretched.

Offline

 

#6 2018-12-18 19:49:23

kinmen
Member
2018-12-17
14

Re: pictures' max width

Well, most of them are classical 1024x768, 800x600 etc, but some aren't. Anyway, setting the height as the max width as you suggested, works.

Offline

 

#7 2018-12-18 22:36:13

executive
Member
2017-08-16
484

Re: pictures' max width

kinmen wrote:

setting the height as the max width as you suggested, works.

Just be aware that your height is also restricted to 320 now. That means if you have any images in portrait orientation, then the width may actually end up less than 320 again. In that case you will need to increase the max height.

Last edited by executive (2018-12-18 22:36:34)

Offline

 

#8 2018-12-19 08:57:39

kinmen
Member
2018-12-17
14

Re: pictures' max width

executive wrote:

I'm confused.

kinmen wrote:

I've set the size to 320x320...  but those are still 320x240...???

I thought that's what you wanted? A width of 320px.


Like the box says, you are specifying the MAXIMUM dimensions. The image will be resized so that both the width AND the height do not exceed the sizes you indicate. There's nothing weird about it.

Yes, 320px of width is what i needed. Tnx for the explanation now I understand how it works. Imho, it would be nice to have the option of setting only one dimension and then automatically set the other by keeping the ratio (like in all the programs for editing pictures and photos), but I understand this would require another plugin.

Offline

 

#9 2018-12-19 09:01:21

kinmen
Member
2018-12-17
14

Re: pictures' max width

executive wrote:

kinmen wrote:

setting the height as the max width as you suggested, works.

Just be aware that your height is also restricted to 320 now. That means if you have any images in portrait orientation, then the width may actually end up less than 320 again. In that case you will need to increase the max height.

Yes, I'm aware of that, in case of need I'll use the bigger size. Thank you so much.

Offline

 

#10 2018-12-19 21:21:00

executive
Member
2017-08-16
484

Re: pictures' max width

kinmen wrote:

it would be nice to have the option of setting only one dimension and then automatically set the other by keeping the ratio

No plugin needed. You can effectively achieve this by setting your desired dimension, and then set the other to something really high (eg '9999'). Piwigo will always maintain the aspect ratio.

Offline

 

#11 2018-12-20 10:15:55

kinmen
Member
2018-12-17
14

Re: pictures' max width

Ah, interesting. But do I need to recreate the different size images once again if I modify the dimensions in that way?

Offline

 

#12 2018-12-20 10:42:37

executive
Member
2017-08-16
484

Re: pictures' max width

It should happen automatically, but you'll have to try.

Offline

 

#13 2018-12-20 10:45:00

kinmen
Member
2018-12-17
14

Re: pictures' max width

Thank you

Offline

 

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2019 · Contact