Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image Aspect Ratios Not Maintained #2

Closed
GoogleCodeExporter opened this issue Apr 10, 2016 · 3 comments
Closed

Image Aspect Ratios Not Maintained #2

GoogleCodeExporter opened this issue Apr 10, 2016 · 3 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Image aspect ratios not maintained, images resized to w x h, instead of
keeping the original aspect ration and making sure it fits within w x h
bounds.  Images get stretched or compressed to fit.

Distorted:
http://mtb.redesigned.com/timthumb.php?src=/itemimages/CBdiaperareawash.jpg&w=14
0&h=180
Original:
http://mtb.redesigned.com/itemimages/CBdiaperareawash.jpg

Distorted:
http://mtb.redesigned.com/timthumb.php?src=/itemimages/item_20050426115915.jpg&w
=140&h=180
Original:
http://mtb.redesigned.com/itemimages/item_20050426115915.jpg




Original issue reported on code.google.com by jjar...@gmail.com on 14 Apr 2008 at 7:52

@GoogleCodeExporter
Copy link
Author

Yes - agreed. While the script aims to make things more production oriented, 
it'd be far more useful if it used a 
MAX width or height without distortion of the other property.

Any suggestions? 

Original comment by kelter...@gmail.com on 12 Aug 2008 at 5:26

@GoogleCodeExporter
Copy link
Author

Hmm - I've tried something like this:

$values = get_post_custom_values("Image"); echo $values[0]; 
?>&w=465&h="100%"&zc=0" 

Which keeps a constant defined width and the height follows to the correct 
aspect ratio, however when the 
script does it's work inside of WordPress (using the MImbo theme) it's not 
xHTML valid because of the quote 
marks around the 100%. Is there a way to do this and still generate clean xHTML?



Original comment by kelter...@gmail.com on 12 Aug 2008 at 6:25

@GoogleCodeExporter
Copy link
Author

this was fixed a long time ago. I hadn't realised the issues section here was 
being
used :)

Setting the width/ height to 100% won't work. Tim Thumb was not programmed to
understand percentages.

The original problem was because the code was stretching the image. There is 
now a
parameter, zc, which will zoom and crop the image instead of just scaling it to 
the
new size.

Original comment by BinaryMoon on 4 Sep 2008 at 11:10

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant