sathyapras / timthumb

Automatically exported from code.google.com/p/timthumb
0 stars 0 forks source link

zoom and crop (zc) works even if the image is bigger than width and height values. #365

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.get 2 images. one big(1600x898) and one small(230x306)
2.try resizing them to (490x305) using these parameters (q=100,a=t,zc=2)
3. then resize them again using these parameters (q=100,a=t)

What is the expected output? What do you see instead?
when adding zc=2 the big image (1600x898) gets top and bottom border but when 
we remove zc=2 the big image don't get any borders.

zc=2 should only add borders if needed and since the big image can be resized 
without borders (in the case that zc=2 is removed) then it should not have 
borders too if zc=2 is added because borders is not needed

What version of the product are you using? On what operating system?
version 2.8.10

Please provide any additional information below.
i think the best way for zc=2 to work is to add borders only if image is 
smaller than the given width and height.

Original issue reported on code.google.com by alhose...@gmail.com on 5 Apr 2012 at 2:34

GoogleCodeExporter commented 8 years ago
I think you have misunderstood how the zc parameter is working. zc=2 scales 
down the image and makes sure nothing is cropped, so sometimes adds borders.

Original comment by BinaryMoon on 25 Apr 2012 at 9:04

GoogleCodeExporter commented 8 years ago
ok, what do you suggest as a config to use so big images(bigger than giving 
dimention) get resized  like zc=1 and small images(smaller than giving 
dimention) resized with zc=2.

Original comment by arabees....@gmail.com on 26 Apr 2012 at 4:42