Guest Posted July 26, 2004 Share Posted July 26, 2004 Hi All, In the cart I'm customizing, I noticed that for those of you who are using the GD image library and are using the resize thumbs in other areas, here is a couple more prices of the code.. Using this below will currently resize your images to the small size found here, http://www.rackspot.com/store/ The code: { $thumb=new thumbnail("$site_dir/images/$image"); $thumb->size_width(75); // set width for thumbnail, or $thumb->size_height(56); // set height for thumbnail, or $thumb->size_auto(45); // set the biggest width or height for thumbnail $thumb->jpeg_quality(75); $thumb->save("$site_dir/images/thumb_$image", $gd_version); } If you do replace your code with that above, remember to delete your thumb_ images first or they won't be regenerated. Chris Quote Link to comment Share on other sites More sharing options...
Guest Posted July 26, 2004 Share Posted July 26, 2004 Does anyone know how to get transparent jpg's? I tried this and many variations but it doesn't work. Any ideas? if (!file_exists("$site_dir/images/" . "thumb_$image")) { $thumb=new thumbnail("$site_dir/images/$image"); $thumb->size_auto(50); $thumb->jpeg_quality(100); //$thumb = ImageCreateFromJpeg("$site_dir/images/$image"); //$white = ImageColorClosest($thumb, 255, 255, 255); //ImageColorTransparent($thumb, $white); //$thumb->transparent($white); $thumb->save("$site_dir/images/thumb_$image", $gd_version); } Thanks, Chris Quote Link to comment Share on other sites More sharing options...
Guest Posted July 29, 2004 Share Posted July 29, 2004 Graphics is kind of my niche...maybe I can help. What exactly do you mean by transparent? Like a faded look? Quote Link to comment Share on other sites More sharing options...
Guest Posted July 29, 2004 Share Posted July 29, 2004 If you're talking about transparent like an object on a transparent background - jpegs don't support transparency. You would have to use a gif format. Teri Quote Link to comment Share on other sites More sharing options...
Guest Posted July 29, 2004 Share Posted July 29, 2004 Hello, Thanks for the reply.. I didn't give it any thought that jpegs can't be transparent.. I don't know much about GD or the functions so I've now been looking for other methods to support gif, jpeg and png images but due to my lack of experience where this stuff is concerned, it's going to take some time before I can sit down and figure that out.. I know how to add gif upload support but I haven't been able to find anything about resizing them.. I'm going to check out netbpm and imagemajick as well and see if I can figure out something.. Thanks again for the reply. Chris Quote Link to comment Share on other sites More sharing options...
Guest Posted July 31, 2004 Share Posted July 31, 2004 ;) Chris, If you don't find a remedy soon and need some help graphic-wise, let me know. There are some tricks and work-arounds that can usually get the job done. Teri Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.