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
  #11  
Old 10-04-2005, 06:59 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

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

Default

If your not sure if your server has GDlibrary installed, place this script on your server and execute you should see some output if its installed.
Code:
<?php echo "<PRE>"; var_dump(gd_info()); ?>
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #12  
Old 10-12-2005, 06:09 AM
 
golfguy golfguy is offline
 

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

Default

Do need GDlibrary if you're not going to use watermarks?
__________________
Version 4.2.3
Reply With Quote
  #13  
Old 10-12-2005, 07:03 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

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

Default

Quote:
Originally Posted by golfguy
Do need GDlibrary if you're not going to use watermarks?

Yes, GD Library is required to generate the smaller thumbnails, as well as watermarking.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #14  
Old 10-12-2005, 01:01 PM
 
creative xpress creative xpress is offline
 

Advanced Member
  
Join Date: Aug 2005
Posts: 71
 

Default

Boomer - when I do everything listed above I get this error


Fatal error: Call to undefined function: func_get_thumbnail_url_() in /usr/local/apache/htdocs/store/include/search.php on line 45


Any Ideas why??
__________________
Xcart
Version: 4.1.6
Reply With Quote
  #15  
Old 10-12-2005, 01:11 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

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

Default

Re-read the instructions and you need to declare this function in include/func.php, its similar to the existing one, just note the trailing "_" in the function name.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #16  
Old 10-12-2005, 01:44 PM
 
creative xpress creative xpress is offline
 

Advanced Member
  
Join Date: Aug 2005
Posts: 71
 

Default

Ok I have resolved that problem and now it is not giving me any errors. However it is not adding a value in the thumb_path column in the database. Will I need to dump all of my products and the upload them again??
__________________
Xcart
Version: 4.1.6
Reply With Quote
  #17  
Old 10-12-2005, 02:05 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

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

Default

The modification won't batch process existing products, simply delete the existin thumbnail and re-add the product and you should see an entry in the table for the newly created "mini" thumb.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #18  
Old 10-12-2005, 06:01 PM
 
creative xpress creative xpress is offline
 

Advanced Member
  
Join Date: Aug 2005
Posts: 71
 

Default

Ok I have another quick question. I have deleted all products and then re-uploaded them through a csv import. Yet it still did not write a path. Is this something that I will have to do 1 by 1 in order to make it work? Or would I need to edit provider/import.php to make it add the path for the mini image?

If I need to edit the import.php any idea about how that could be done??

Thanks!
__________________
Xcart
Version: 4.1.6
Reply With Quote
  #19  
Old 10-12-2005, 08:16 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

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

Default

Quote:
Originally Posted by creative xpress
Or would I need to edit provider/import.php to make it add the path for the mini image?

If I need to edit the import.php any idea about how that could be done??

No theres zero mods done to import.php so only one by one is possible, you'll need to re-implement the GD functions into the import.php files in order to do this in batch.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #20  
Old 10-14-2005, 01:12 PM
 
creative xpress creative xpress is offline
 

Advanced Member
  
Join Date: Aug 2005
Posts: 71
 

Default

Ok this is what the import.php code looks like where it pertains to the thumnail.

Code:
# set thumbnail if (isset($extra_data["thumbnail"]) && !empty($extra_data["thumbnail"])) { if (dirname($extra_data["thumbnail"]) == ".") $path = $import_file["images_directory"].basename($extra_data["thumbnail"]); else $path = $extra_data["thumbnail"]; $source = 'S'; if ((strncasecmp($path, "http://", 7) === 0) || (strncasecmp($path, "ftp://", 6) === 0) || (strncasecmp($path, "https://", 8) === 0)) { $source = 'U'; } $tmp_data = array ("file_path"=>$path, "imtype"=>"T", "source"=>$source); if (func_check_image_posted($tmp_data,"T")) { list($tmp_data["file_size"], $tmp_data["image_x"], $tmp_data["image_y"], $tmp_data["image_type"]) = func_get_image_size($tmp_data["file_path"]); $image_data = func_get_image_content($tmp_data, $productid); $store_in = ($config["Images"]["thumbnails_location"] == "FS"?"FS":"DB"); db_query("DELETE FROM $sql_tbl[thumbnails] WHERE productid='$productid'"); if ($store_in == "FS") db_query("INSERT INTO $sql_tbl[thumbnails] (productid, image_path, image_type) VALUES ('$productid', '".addslashes($image_data["image"])."', '$image_data[image_type]')"); else db_query("INSERT INTO $sql_tbl[thumbnails] (productid, image, image_type) VALUES ('$productid', '$image_data[image]', '$image_data[image_type]')"); db_query("UPDATE $sql_tbl[products] SET image_x='$image_data[image_x]', image_y='$image_data[image_y]' WHERE productid='$productid'"); } }

Would it be as simple as adding the thumb_path values to the insert queries? Or is there more to it than that?

By the way thanks for all of your help Boomer!!

Cam
__________________
Xcart
Version: 4.1.6
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 06:42 PM.

   

 
X-Cart forums © 2001-2020