Long image File Name prevents Main Image Save

sky writer

I already made the change using phpMyAdmin, but thanks for following up.  That info will be handy for others who are affected by this.

Cheers!

freeSbee

Hi sky writer

Use a database tool like phpMyAdmin or your favorite one to alter the table.

First adjust prefix_ to the table prefix you have choosen during installation, then execute the following SQL statement:
ALTER TABLE  `prefix_mod_bakery_items` CHANGE  `main_image`  `main_image` VARCHAR(255);

Regards Christoph

sky writer

Thank you so much, Christoph!

I looked all over, but didn't make it to the database.  Learn something new every day.

Just so that I understand, was the problem that the file name, and the main image file name don't match after the file is truncated, so the main image save doesn't go through?  I ask because there is no error message given, just "success".  It might be worth putting something in the next update so that the 50 byte limit is known.

Hope this helps someone else.

freeSbee

Hi sky writer

The main image file name is stored in a database field with type varchar(50).
Cherries_in_the_Sunroom_Acrylic_36x48_1190oooo.jpg is exactly 50 bytes - anything longer than that will be  truncated.
Change the main_image field of the mod_bakery_items table to type varchar(255).

Regards Christoph

sky writer

I have been using bakery for a while now and am very happy with it, but I just noticed a problem.  When I have long file names for images, it will not let me save them as the main image.

For instance, this file will work:
http://www.webpagestuff.com/media/bakery/images/item38 /Cherries_in_the_Sunroom_Acrylic_36x48_1190oooo.jpg

but this one, with just one extra character, will not.

http://www.webpagestuff.com/media/bakery/images/item38/Cherries_in_the_Sunroom_Acrylic_36x48_1190ooooo.jpg

They both upload, and the thumbnail and file name are visible in the backend, but if I click the radio button beside the second file (with the extra character in it's name) and click save, it brings up the screen with "Success" but when you return to the Modify_item page, the main Image radio button in no longer selected, and so that item is not visible in the front end.

Very frustrating.  I've searched through all the files, looking for some sort of max file length or max path length but can not find anything.

I welcome any suggestions.  I know I can use shorter file names, but this site will soon be taken over by my client and he has a tendency to use long file names, and so, if possible, I would like to find a fix rather than telling him to change his file naming routine.