| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
quick hack to eliminate thumbnail image jaggies (libgd req) | ||||
|
|
Thread Tools | Search this Thread |
#21
|
|||||||||
|
|||||||||
The code I posted from include/product_modify.php has the section of code you'll need to copy into the if ($store_in == "FS") condition and setup accordingly. However most of the code is arleady there just needs to be reconfigured to work properly with importing, etc.
hth.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart. |
|||||||||
#22
|
|||||||
|
|||||||
The product_modify.php seems to be working. xcart_thumbnails.thumb_path contains
/home/teststore/domains/teststore.com/public_html/skin1/images/thumb/6.jpg and I checked with FTP and the file exists, the thumbnal image displays but the larger "thumbnail" on the detail page no longer displays. It's got "little red x" Syndrome xcart_thumbnails.image_path contains /home/teststore/domains/teststore.com/public_html/images/t_6.jpg but the file does not exist Did I delete something out of product_modify that I shouldn't have?
__________________
Version 4.2.3 |
|||||||
#23
|
|||||||
|
|||||||
My test store still has the product detail image problem, but I thought I'd pass along a work around to the import problem.
This is based on my decision to name the new "mini" thumbnails the same as the image_path with "_width" as a suffix. I batch resized my full size images with Fireworks (Photoshop can do this as well) appending "_120" to the file name, and uploaded them to the same place as my other images. after you have created the thumb_path column, while still in SQL Code:
__________________
Version 4.2.3 |
|||||||
#24
|
|||||||||
|
|||||||||
If all you did was copy the commented code and the sql changes at the end of the commented code, should be all you need for both the new and update products sections of the code. Make sure you've got the proper full paths to where you are going to be storing the mini thumbs. It should NOT affect the "Product Detail" thumbnails.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart. |
|||||||||
#25
|
|||||||
|
|||||||
I tried the same code from the previous files and now I get an error concerning the fopen, fwrite, fclose, and image destroy. as not a valid stream resource. fopen claims no such file or directory.
Is it possible that it is doing this because I am updating products rather than adding new ones? Thanks
__________________
Xcart Version: 4.1.6 |
|||||||
#26
|
|||||||||
|
|||||||||
More than likely the directory you put in for the $handle variable isn't readable or writeable by the web server. Make sure the proper chmod and chown are on the fopen path you specified.
Keep in mind this was code snippet I had laying around from the orginal mod that was written for 3.5.9 and ported to 4.0.x afterwards. Be sure GD library is installed and enabled. Written with: GD Version bundled (2.0.28 compatible) If you want to find the version or see if its available or enabled: X-Cart admin -> Summary find php and click "details". Here's a cleaned up version of the product_modify.php file with no watermarking code commented out, may help debugging it easier. If you need to find if the table is appearing simply put {$thumb} in product_thumbnail.tpl and you should see a full path to the image. Code:
... And here's product_modify.php: Code:
Also there are two lines I kept in. imagecopyresampled ... and imagecopyresized. If your having issues you can try and swap the two out to see if you get different results. There is also another GD function call ImageAntiAlias, it may need to be uncommented/enabled as well. References: http://us2.php.net/imageantialias http://us2.php.net/manual/en/function.imagecopyresampled.php http://us2.php.net/manual/en/function.imagecopyresized.php
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart. |
|||||||||
#27
|
|||||||||
|
|||||||||
Simple update script
Here's a simple script that may help with the updating of existing products:
Code:
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart. |
|||||||||
#28
|
|||||||
|
|||||||
Boomer - Would I just put that script into its own php file and then run it or does this script go into an existing php page?
__________________
Xcart Version: 4.1.6 |
|||||||
#29
|
|||||||||
|
|||||||||
No it would be a seperate php page. The script is useful if you have generated thumbnails via photoshop batch persay and are wanting to update the existing products with the new generated thumbnails.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart. |
|||||||||
#30
|
|||||||
|
|||||||
Thanks again Boomer- I am going to give your code a whirl on one of our latest sites.....
I'll see what I can contribute once it's working the images. - Mike
__________________
4.1.9 |
|||||||
|
|||
X-Cart forums © 2001-2020
|