Thumbnail RESIZE!

Hi



If I change the thumbnail size on a product ie default 120 x 120 new 180 x 180 and re generate the images all is fine!



QUESTION, How can I change ALL to new size WITHOUT going in to each product?



Would take for ever to do one at a time. Wondered if there was a way to MASS change ie via database??? :confused:

A long time ago, and with version 1.3.5, I did this just by re-importing my main images using a .csv file and leaving the thumbnail column in there but leaving it blank.



I was told by CS-Cart Support that it wouldn’t work … but it did.



I exported my file, left the detailed image description as it was, deleted all the data in the thumbnail column and reimported the list.



It may be worth giving it a go with version 2 but I’m not sure if it will work. Try with a couple of your products and see what happens.

[quote name=‘Lyn’]A long time ago, and with version 1.3.5, I did this just by re-importing my main images using a .csv file and leaving the thumbnail column in there but leaving it blank.



I was told by CS-Cart Support that it wouldn’t work … but it did.



I exported my file, left the detailed image description as it was, deleted all the data in the thumbnail column and reimported the list.



It may be worth giving it a go with version 2 but I’m not sure if it will work. Try with a couple of your products and see what happens.[/QUOTE]





MMMMMMMMMMM! Might try that. Thanks

Yup! That works a treat.



:stuck_out_tongue: Thank you for the help!:stuck_out_tongue:

Glad it still works in version 2.



Check whether it is adding new thumbnails or whether it is overwriting the old ones. I seemed to end up with lots of extra images in my folders but I’m not sure whether this was the result of my learning experience and playing around with importing stuff when I first started out or whether it was as a result of reimporting the product list to fix the thumbnail sizes.



So just check before doing the whole lot in one go so you don’t get thousands of unwanted images as you may be better off deleting your old thumbnails (by ftp) before reimporting your list.



Just a tip.

Thanks again :cool:

For anyone else out there wondering, this is how I’ve done it…



Delete the thumbnail_image files in your various folders, update the size you WANT them to be in the admin-settings, and then go to catalog-products-global update(top left), check “regenerate thumbnails”, then hit “add products” and select all. That should do it…you prob dont have to delete first, but I usually do just to be sure.



Hope it helps…



-Joe

[quote name=‘JNizhnik’]For anyone else out there wondering, this is how I’ve done it…



Delete the thumbnail_image files in your various folders, update the size you WANT them to be in the admin-settings, and then go to catalog-products-global update(top left), check “regenerate thumbnails”, then hit “add products” and select all. That should do it…you prob dont have to delete first, but I usually do just to be sure.



Hope it helps…



-Joe[/QUOTE]



Is there a way to have 3 size thumbs?


  1. 100px
  2. 300px
  3. original size (640px)



    ?



    And what if you have more then 3000 products?

Each product can only have one image pair (thumb and detailed) that is directly associated with it so if you are asking about 3 different sizes for one picture, I’d say no.



If you are asking if you can have three different sizes in general, like some products are 100 while others are 300 then yes. You don’t have to let cs-cart generate your thumbnails for you, you can upload whatever size thumb you want that you have shrunk yourself using some software.

Hi



BEWARE when doing any updating of images/thumbnails.



You will lose all your ALT tags unless you export and delete the pathe, leaving the ALT tag ie #alt tag in the thumbnail path.



Just used the second option to do approx half my site and now need to individually re-do the alt tags!!!



Swings and roundabouts with these two methods!

Cant we export the data to excel and use the find and replace command to change all the paths/alt tags at once? leaving the #Alt tag in



John

[quote name=‘johnbol1’]Cant we export the data to excel and use the find and replace command to change all the paths/alt tags at once? leaving the #Alt tag in



John[/QUOTE]



Yeah! This was my point! REMEMBER to do it or lose it!!!:rolleyes:

Along these lines, here is my situation.


  1. I have brought in thumbnails from 1.3.5 that are 100 x 100 (now using 2.0.12).


  2. Now, I would like to convert some images to 200(w) x varying height.


  3. I would still like the thumbnails to be 100 pixels wide on the products list page, but I would like them to be 200 pixels wide on the product details page.


  4. I have tried changing ALL the thumbnail options in CS-Cart, but the images still show up as 100 x 100 on all pages no matter what options I choose



    What am I doing wrong?!

[quote name=‘knoxbury’]Along these lines, here is my situation.


  1. I have brought in thumbnails from 1.3.5 that are 100 x 100 (now using 2.0.12).


  2. Now, I would like to convert some images to 200(w) x varying height.


  3. I would still like the thumbnails to be 100 pixels wide on the products list page, but I would like them to be 200 pixels wide on the product details page.


  4. I have tried changing ALL the thumbnail options in CS-Cart, but the images still show up as 100 x 100 on all pages no matter what options I choose



    What am I doing wrong?![/QUOTE]



    Can.t be done as far as I know. one impacts the other!

are you re generating after changing? and perhaps clear the cache…



backup…backup…backup

[quote name=‘johnbol1’]are you re generating after changing? [/QUOTE]



What does “regenerating” mean anyway? What is actually taking place when I choose to regenerate thumbnails?

I changed my image size yesterday and had to re generate them, I assume it clears the old cahce out and enters the new details to all thumbnails, other than this you just re import all your data with the new sizes already set in the admin/setting/thumbnail.



I reckon it just grabs all the images again from the backup folder and replaces them with the new size info you have adjusted. Beware though I did this a few months ago and they all went to the wrong products, though this has only happend 1 time and I have regenerated about 9 times since.



John

[quote name=‘BarryH’]Hi



BEWARE when doing any updating of images/thumbnails.



You will lose all your ALT tags unless you export and delete the pathe, leaving the ALT tag ie #alt tag in the thumbnail path.



Just used the second option to do approx half my site and now need to individually re-do the alt tags!!!



Swings and roundabouts with these two methods![/QUOTE]



I contacted Cs-cart about this issue. They say that this is a bug and that they will fix it soon so that the “alt” info will stay put. Here is the code Cs says to replace so all “alt” info will not be lost.



I have not tried this yet as I don’t have “alt tag” info in place at this point. I just needed to resize my images which was an easy fix with the a second method listed above. However, I thought it to be a bit strange that the “alt” info was lost. Big Bug!



Here is the code they suggested if anyone is interested. Also, I’m not even sure what exactly this is for…I assume the “alt tag” issue.



In order to fix it you should do the following:

  1. Open the “products.php” file located in the “controllers/admin” directory of your CS-Cart installation.
  2. Replace the following part of code:





    fn_update_image_pairs(array(), $_detailed, $_pairs_data, $pair[‘object_id’], ‘product’);

    with this one:



    fn_update_image_pairs(array(), $_detailed, $_pairs_data, $pair[‘object_id’], ‘product’, array (), ‘’, 0, false);

    and this one:



    fn_update_image_pairs(array(), $_detailed, $_pairs_data, $cpair[‘object_id’], ‘product_option’, array(), ‘product’, $pair[‘object_id’]);

    with this one:



    fn_update_image_pairs(array(), $_detailed, $_pairs_data, $cpair[‘object_id’], ‘product_option’, array(), ‘product’, $pair[‘object_id’], false);
  3. Save the file.
  4. Open the “fn.images.php” located in the “core” directory of your CS-Cart installation.
  5. Replace the following part of code:



    function fn_update_image_pairs($icons, $detailed, $pairs_data, $object_id = 0, $object_type = ‘product’, $object_ids = array (), $parent_object_type = ‘’, $parent_object_id = 0)

    with this one:



    function fn_update_image_pairs($icons, $detailed, $pairs_data, $object_id = 0, $object_type = ‘product’, $object_ids = array (), $parent_object_type = ‘’, $parent_object_id = 0, $update_alt_desc = true)

    and this one:



    if ((empty($data) && !empty($pair_id)) || !empty($data)) {

    with this one:



    if (((empty($data) && !empty($pair_id)) || !empty($data)) && $update_alt_desc == true) {
  6. Save the file.



    Please check it and let us know the result.



    Hope this helps someone…they are adressing the issue.



    Thanks,

    Stu

[quote name=‘BarryH’]Hi



BEWARE when doing any updating of images/thumbnails.



You will lose all your ALT tags unless you export and delete the pathe, leaving the ALT tag ie #alt tag in the thumbnail path.



Just used the second option to do approx half my site and now need to individually re-do the alt tags!!!



Swings and roundabouts with these two methods![/quote]



I contacted Cs about this issue and they said that the “alt tag” issue is a bug that they will be correcting. This is the code they recommended us to replace. We didn’t have any “alt” info at this point, so this didn’t apply to us but thought it might be a bug. Anyway, not sure what this code does but maybe someone can make sense of it. Sorry the layout isn’t good but not sure how to transfer the info to this thread.



In order to fix it you should do the following:


  1. Open the “products.php” file located in the “controllers/admin” directory of your CS-Cart installation.


  2. Replace the following part of code:


fn_update_image_pairs(array(), $_detailed, $_pairs_data, $pair['object_id'], 'product');



with this one:
fn_update_image_pairs(array(), $_detailed, $_pairs_data, $pair['object_id'], 'product', array (), '', 0, false);




and this one:


fn_update_image_pairs(array(), $_detailed, $_pairs_data, $cpair['object_id'], 'product_option', array(), 'product', $pair['object_id']);


with this one:

fn_update_image_pairs(array(), $_detailed, $_pairs_data, $cpair['object_id'], 'product_option', array(), 'product', $pair['object_id'], false);



3) Save the file.



4) Open the “fn.images.php” located in the “core” directory of your CS-Cart installation.



5) Replace the following part of code:


function fn_update_image_pairs($icons, $detailed, $pairs_data, $object_id = 0, $object_type = 'product', $object_ids = array (), $parent_object_type = '', $parent_object_id = 0)




with this one:


function fn_update_image_pairs($icons, $detailed, $pairs_data, $object_id = 0, $object_type = 'product', $object_ids = array (), $parent_object_type = '', $parent_object_id = 0, $update_alt_desc = true)




and this one:

if ((empty($data) && !empty($pair_id)) || !empty($data)) {



with this one:

if (((empty($data) && !empty($pair_id)) || !empty($data)) && $update_alt_desc == true) {


6) Save the file.



Please check it and let us know the result.



Hope this helps someone…backup, backup, backup!!! I learned my lesson, ha!



Regards,

Stu

Thanks Jesse! :cool: