andy's php projects
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Script and site usage:
All of the scripts on this site are provided free for non-commerical, personal or non-profit use. If you find these scripts useful to you, appreciate the free support, or are just an all round nice person, then why not donate a little dosh? If you wish to use any of these in a commercial system, please refer to the payment plan.


Cropping one pixel out?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> Crop Canvas
View previous topic :: View next topic  
Author Message
trevkin
Newbie


Joined: 15 Jan 2007
Posts: 2

PostPosted: Mon Jan 15, 2007 1:39 pm    Post subject: Cropping one pixel out? Reply with quote

Hello,

Thanks for a great tool, i have just one very very little problem (one pixel in fact Smile )....

I use a combination of your crop class and dropshadow class to create square thumbnails of 100 pixels square.
I fix the interface to 300x300 max image size box and the cropping tool to 200x200 and make the resize proportional.
This then saves the cropped image and then uses dropshadow to create a 100x100 pixel thumbnail.
This works great but sometimes however a 99x100 or 100x99 thumbnail appears.
This is coming from the crop tool which occasionally creates an image that is one pixel wider or higher then the other axis.
Im assuming that this is some kind of math problem inside the class that is either rounding up or down in certain circumstances.
It isnt specific to the image (it can sometimes do it, sometimes not on the same image) but more the position you crop from in an image.

Hope someone can help, thanks
Back to top
View user's profile Send private message
amnuts
Site Admin


Joined: 01 Sep 2002
Posts: 662
Location: East Sussex, England

PostPosted: Wed Jan 17, 2007 11:53 am    Post subject: Reply with quote

Hi, and welcome to the board!

It certainly does sound like a rounding issue, as rounding takes place quite a bit, especially when using ratio-based sizing and the max display size.

When you say you set the interface to 300x300, is that using the max display size, or do you mean that you fixed the initial crop size to be 300x300?

Is it always the cropping part that incorrectly crops the size? For example, have you saved the crop before resize to make sure that it's correct according to the interface before the resize takes place? Might help to track down if it's definitely the cropping part rather than the resizing.

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
trevkin
Newbie


Joined: 15 Jan 2007
Posts: 2

PostPosted: Thu Jan 18, 2007 6:22 am    Post subject: Reply with quote

Hi Andy,

Sorry i was not too clear, yes i set the max display size to 300x300 and i fix the default crop size to 200x200 but make it proportionally resizeable.
The incoming image sizes can vary wildly (probably why its happening) but i leave the thumbnailer to worry about that after the crop.
I have eliminated the dropshadow class from the error, its always the cropped image pre-thumbnailing where the discrepency occurs.
I doubt this would be a problem for most users but perhaps something that checked whether the required crop has equal sides could ensure that the resulting image was the same.

Cheers for you help.

Trev
Back to top
View user's profile Send private message
amnuts
Site Admin


Joined: 01 Sep 2002
Posts: 662
Location: East Sussex, England

PostPosted: Thu Jan 18, 2007 7:28 am    Post subject: Reply with quote

Great feedback! Thanks for clearing that up for me, Trevkin. I'll have a look in to the issue at some point and see what I can do.

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
wozzzzza
Newbie


Joined: 12 Feb 2007
Posts: 6

PostPosted: Fri Feb 16, 2007 1:07 am    Post subject: Reply with quote

any news on a fix for this 1 pixel out cropping? im noticing it too.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> Crop Canvas All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group