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.


Problem with resizing and cropping and PNG

 
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
Klian
Newbie


Joined: 06 Jan 2007
Posts: 3

PostPosted: Sat Jan 06, 2007 6:22 pm    Post subject: Problem with resizing and cropping and PNG Reply with quote

Hi,

I have this code:

Code:

if ($ds->loadImage($img_final)) {
   $ds->resizeToSize(125, 0);
   $cc->_imgOrig = $ds->_imgFinal;
    $cc->cropToSize(CROP_W, CROP_H, ccCENTRE);
   $cc->saveImage($img_mini);
    $cc->flushImages();
}


This works fine with JPG and GIF images, but when I try to upload a big PNG it doesnt save the image ($cc->saveImage($img_mini) )

Before adding the resizeToSize function and using only the CropCanvas class , it was working great.

Any help would be appreciated....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: Sat Jan 06, 2007 8:14 pm    Post subject: Reply with quote

Hi, and welcome to the board!

What are the sizes of CROP_W and CROP_H? If they are bigger then what your image ends up being then it will product an error. Is '$img_mini' set to a path location and is it writable? Does your GD installation have PNG support?

Try turning on debugging in the classes and see what messages it gives you when trying to process the png file.

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


Joined: 06 Jan 2007
Posts: 3

PostPosted: Sun Jan 07, 2007 6:25 am    Post subject: Reply with quote

What are the sizes of CROP_W and CROP_H?
125 and 125

If they are bigger then what your image ends up being then it will product an error.
Ok...But Ive deleted that line, and it doesnt work with this code:
Code:
if ($ds->loadImage($img_final)) {
   $ds->resizeToSize(125, 0);
   $cc->_imgOrig = $ds->_imgFinal;
   $cc->saveImage($img_mini);
    $cc->flushImages();
}


Is '$img_mini' set to a path location and is it writable?
Yes, because it works with jpg,gif and small png

Does your GD installation have PNG support?
Yes, because it works with small png

Sad
Back to top
View user's profile Send private message
Klian
Newbie


Joined: 06 Jan 2007
Posts: 3

PostPosted: Sun Jan 07, 2007 6:56 am    Post subject: Reply with quote

I was thinking in your post about the CROP_W and CROP_H, and Ive fixed it with this code Very Happy

Code:

if ($ds->loadImage($img_final)) {
   $ds->resizeToSize(125, 125);
   $cc->_imgOrig = $ds->_imgFinal;
    $cc->cropToSize(CROP_W, CROP_H, ccCENTRE);
   $cc->saveImage($img_mini);
    $cc->flushImages();
}
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