X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   quick hack to eliminate thumbnail image jaggies (libgd req) (https://forum.x-cart.com/showthread.php?t=17012)

B00MER 10-24-2005 02:53 PM

Ooops :-k , 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.

mffowler 10-24-2005 03:04 PM

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

creative xpress 10-24-2005 03:07 PM

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?

B00MER 10-24-2005 03:19 PM

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:
:arrow: http://us3.php.net/manual/en/ref.image.php

hope that helps. :wink:

creative xpress 10-24-2005 05:01 PM

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!!!

:oops:

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

steveparks 10-25-2005 04:28 AM

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

golfguy 10-25-2005 04:46 AM

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

steveparks 11-01-2005 02:50 PM

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

Bodger 11-02-2005 01:55 AM

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.

TelaFirma 11-02-2005 02:22 AM

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.


All times are GMT -8. The time now is 01:54 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.