Hi,
When using pthumb to output images with fixed size sometimes the result differs by 1 pixel.
I ask for image height of 400px, and some images always result in 399px.
I could not detect the difference in the source images which cause this - I assume some rounding of aspect ratio...
I changed to image+ but I get the same behavior.
pthumb:
<img src='[[+tv_image:pThumb=`w=400&h=270&zc=1`]]'>-->
image+:
Target (minimal) Width: 400
Target (minimal) Height: 270
Output as Image+, Generate Thumb URL: yes, not custom output chunk
My temporary solution using image+ is to re-crop it with a very small change - the recalculation usually fixes it and the image output size is as expected.
Since I have an image list with float left, a 1-pixel change in height breaks the entire grid.
Did anyone else encounter this and have a solution?
I would like to avoid any of the following solutions I thought of:
- have the image as a CSS background (bad for SEO)
- have the image with fixed width height according to the breakpoint (not responsive as I would like)
- CSS object fit (best solution I found but a problem with browser support)