Author Topic: Thumbnail problem in Add Category  (Read 2607 times)

doorknob

  • Jr. Member
  • **
  • Posts: 151
Thumbnail problem in Add Category
« on: September 30, 2008, 01:41:39 am »
I have encountered two problems with adding images to categories when adding a new record.
1 When using the Auto-Create Thumbnail feature, the program appears to first of all copy the selected image to the shop_image/category directory with a generated suffix to the name to ensure uniqueness. It then creates the thumbnail in the same directory with another generated name suffix. Finally, the thumbnail is copied to the shop_image/category/resized directory with yet another generated name suffix with the thumbnail size also appended. The problem is that the first version if the thumbnail is not then deleted. Because it is not referenced in the table, it can never be found again and clutters the directory forever.
2 The second problem relates to what happens if the add category function fails for any reason. The creation of the image files occurs before the new category is validated. If for any reason the category details are rejected, the image files are not deleted, again to clutter the directory forever. In an ideal world, the files wouldn't be created until after the decision has been made to accept the record but even if the design of the program makes that difficult, the files should be deleted again afterwards.
A similar issue also exists when creating new product records.
Any chance of a fix?
Regards
Phil

guimplenchik

  • Beginner
  • *
  • Posts: 26
Re: Thumbnail problem in Add Category
« Reply #1 on: September 30, 2008, 18:15:45 pm »
I have the same problem with 3 images, which VM creates during uploading a product image. I also placed the post but nobody can't say anything about that. (http://forum.virtuemart.net/index.php?topic=46005.msg147195#msg147195) It seems that it is OK for everyone, that VM makes a lot of extra useless files on their servers.

Definitely, something wrong with image.Tools.class.php and ps_product.php but I can't figure out what exactly causes this mysterious extra thumbnail file which is useless. I noticed that it is not even a temp file. I turned the Debug mode in VM CP and tried to upload an image. The temporary thumbnail file had a different name, and it was deleted properly..

I don't know, Developers should have a look into this...