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.


the cropped image looses its quality ! why ?

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


Joined: 13 May 2005
Posts: 9

PostPosted: Wed May 25, 2005 9:06 am    Post subject: the cropped image looses its quality ! why ? Reply with quote

Hi andy,
As I said on a previous topic, I replaced the GDversion check and now I can crop the area I want, there are no more problem of startX, startY etc...

But now the resulting image of the crop is so dirty !! It seems like it's encoded with 16 colors !! I tried to save it in max quality .jpg and in .png, but it's the same ! Rolling Eyes In both cases, my saved image is so damaged !!

I think it comes from the GDversion. Do you see something wrong below ??
Quote:
GD Support enabled
GD Version 2.0 or higher
FreeType Support enabled
FreeType Linkage with freetype
JPG Support enabled
PNG Support enabled
WBMP Support enabled


thanks in advance
julien
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 May 25, 2005 9:51 am    Post subject: Reply with quote

hmmm... Not too sure about this. Are you sure that the imagecreatetruecolor() function is being used? It came into GD 2.0.1, so you should be okay, but worth checking anyway. Is the version of GD being detected coming out as 2? You could try echoing out the value to make sure.

Do you have a demo we could look at?

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


Joined: 13 May 2005
Posts: 9

PostPosted: Thu May 26, 2005 3:04 am    Post subject: Reply with quote

hi,
thanks to my work mate david, it now works as we want !!!

We have php version 4.2.1 on a windows server.

So here is what we changes in the code (in cropcanvas.php:
Were you have
Code:
$gdVersion = $this->_getGDVersion();

We added
Quote:
$this->_gdVersion = $gdVersion[0];
Code:
, because it returns an array, and the version is specified at row[0].

And after that, we tried this :
if ($this->_gdVersion == 2)
{
$this->_imgFinal = @ImageCreateTrueColor($nx, $ny);
//@ImageCopyResampled($this->_imgFinal, $this->_imgOrig, 0, 0, $ox, $oy, $nx, $ny, $nx, $ny);
@ImageCopyResized($this->_imgFinal, $this->_imgOrig, 0, 0, $ox, $oy, $nx, $ny, $nx, $ny);
}
Code:


I don't know how the hell he got this idea, but it works !! with copyresampled it's not good, but with copyresized it goes pretty well.

Maybe you'll be able to tell us more about this ??  :D
Thanks again for answering so quickly ! :lol:
Back to top
View user's profile Send private message
sepultubob
Newbie


Joined: 13 May 2005
Posts: 9

PostPosted: Thu May 26, 2005 3:06 am    Post subject: Reply with quote

oh sorry for the layout !! Rolling Eyes

I've been messing around with the tags, and here is the result !
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