Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

quick hack to eliminate thumbnail image jaggies (libgd req)

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #41  
Old 10-24-2005, 02:53 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

Ooops , try...

Code:
#imagecopyresized($thumb_img, $photoImage, 0,0,0,0, imagesx($thumb_img), imagesy($thumb_img), imagesx($photoImage), imagesy($photoImage)); imagecopyresampled($thumb_img, $photoImage, 0,0,0,0, imagesx($thumb_img), imagesy($thumb_img), imagesx($photoImage), imagesy($photoImage));

Find this code and swap out the # comment also.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #42  
Old 10-24-2005, 03:04 PM
 
mffowler mffowler is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Melbourne, Australia
Posts: 811
 

Default

Hi Cam,

I'm sure it'll be worth it in the end. As for the unsharp php- I think the function could be added during the generation with Boomer's code. But, perhaps he can see exactly much easier than my trial and error methods.

I just know that our forum has this and it generates great looking thumbnails. So I checked the image code. Quite bizarre that this hasn't been released as a complete mod with so many people wasting all the bandwidth serving images.

- Mike
__________________
4.1.9
Reply With Quote
  #43  
Old 10-24-2005, 03:07 PM
 
creative xpress creative xpress is offline
 

Advanced Member
  
Join Date: Aug 2005
Posts: 71
 

Default

That did not make a noticable improvement. Does it matter what combination is active? For example

ImageAntiAlias($photoImage, true);
and
imagecopyresampled($thumb_img, $photoImage, 0,0,0,0, imagesx($thumb_img), imagesy($thumb_img), imagesx($photoImage), imagesy($photoImage));


or

ImageAntiAlias($photoImage, true);
and
imagecopyresized($thumb_img, $photoImage, 0,0,0,0, imagesx($thumb_img), imagesy($thumb_img), imagesx($photoImage), imagesy($photoImage));


or does that not make a difference?
__________________
Xcart
Version: 4.1.6
Reply With Quote
  #44  
Old 10-24-2005, 03:19 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

ImageAlphaBlending() & imagecopyresampled() would be the two calls to make to resample the image properly. I had this issue on a different server, this is why the two other functions call I left in. More than likely the answer lies in the GD library docs:
http://us3.php.net/manual/en/ref.image.php

hope that helps.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #45  
Old 10-24-2005, 05:01 PM
 
creative xpress creative xpress is offline
 

Advanced Member
  
Join Date: Aug 2005
Posts: 71
 

Default

I got this resolved. It was not a problem with your code, your code works great!!! What I had done is some how managed to set the height and width values (that you had set at 75) to 7. Yet I was calling up the image at 80 in x-cart.

This is what happens when stupid people play with powerful toys!!!



Thanks for all your help and for this great mod. I will be trying out the php script to get all of the images reset in the next couple of days i will let you know how it turns out.

Cameron
__________________
Xcart
Version: 4.1.6
Reply With Quote
  #46  
Old 10-25-2005, 04:28 AM
 
steveparks steveparks is offline
 

Advanced Member
  
Join Date: Jan 2003
Location: UK
Posts: 87
 

Default second thumbnail

Hi Boomer and co

This is a great mod - so thanks very much for sharing it

How difficult is it going to be to also resize the uploaded image, so that a member of staff can upload any image they have, and it creates a thumbnail for product listings etc of 70px width, but also resizes the main image to be 200px, with that image being used when people view the actual product page?

Any suggestions for code to achieve this please?

thanks
steve
__________________
--------------
RHEL3/Apache2/PHP4/MySQL4/Plesk7.5.3
X-Cart 4.0.16 - Live
X-Affiliate
X-AOM
ez-checkout
ez-upsell
--------------
Reply With Quote
  #47  
Old 10-25-2005, 04:46 AM
 
golfguy golfguy is offline
 

Senior Member
  
Join Date: Apr 2005
Location: Omaha,NE
Posts: 108
 

Default

If you have (and you should have something for image manipulation) Photoshop or Macromedia Fireworks you can "batch" resize your images. I created 1000 thumnail images in about 30 seconds w/fireworks
__________________
Version 4.2.3
Reply With Quote
  #48  
Old 11-01-2005, 02:50 PM
 
steveparks steveparks is offline
 

Advanced Member
  
Join Date: Jan 2003
Location: UK
Posts: 87
 

Default image resizing

Yeah, but I find that some colleagues who are perfectly capable of doing everything else to add a product just don't get images - they don't see that a pixellated image, or one that hasn't maintained the ratio when being resized is not acceptible.

I'd love to be able to adapt this mod so that it creates two resized images - one at say 300x300 for the main product view, and one at 150x150 for the category list view - that would save a lot of my time redoing images and explaining why i had to!



cheers
steve
__________________
--------------
RHEL3/Apache2/PHP4/MySQL4/Plesk7.5.3
X-Cart 4.0.16 - Live
X-Affiliate
X-AOM
ez-checkout
ez-upsell
--------------
Reply With Quote
  #49  
Old 11-02-2005, 01:55 AM
 
Bodger Bodger is offline
 

Advanced Member
  
Join Date: Oct 2005
Location: South Devon. UK
Posts: 65
 

Default

Greetings Folks,

This Mod appears to be what I need to solve my image probs; but I am new to X-Cart, and am definitely NOT a programmer.

However, I am not afraid to get my hands dirty; but obviously, I don't want to screw the system and have to completely re-install.

Before I take a crack at it, can a kind person tell me whether or not this mod has been released as a complete fix - either commercially, or as a free offering, please ?

With Thanks,

Mike.
__________________
Web:
X-Cart Gold 4.1.3
Apache 1.3.37 (Unix)
Linux
PHP 4.4.3
MySQL 4.1.19- standard

Home PC Dev:
X-Cart Gold 4.1.3
Uniform Server
PHP 5.1.1
MySQL server 5.0.17
MySQL client 4.1.7
Web Server Apache/2.0.55 (Win32)
Reply With Quote
  #50  
Old 11-02-2005, 02:22 AM
  TelaFirma's Avatar 
TelaFirma TelaFirma is offline
 

X-Adept
  
Join Date: Nov 2002
Location: North Carolina USA
Posts: 930
 

Default

I have a Mod that will allow you to upload one large image for the product and it will dynamically generate new images for the Product page, the Thumbs for the product listing pages, thumbnails for the shopping cart and also a popup for a detail - all from one large image. It will also do the same with Detail images, creating small thumbnails for the detail images and a popup from them. All the dimensions for each are also configurable from within Admin.

This will handle JPG, GIF and PNG images and also applies an unsharp mask to the thumbnails that it generates so that they are not blurry.

This makes image management much easier and you do not have to worry about resizing in an application such as Photoshop. You would also not have to worry about creating and uploading multiple images.

Let me know if anyone is interested.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 04:44 AM.

   

 
X-Cart forums © 2001-2020