VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: borro on August 17, 2013, 10:12:22 AM

Title: Where is the code that creates previews?
Post by: borro on August 17, 2013, 10:12:22 AM
Hello.

I need Virtuemart 2.0 not to add image suffix in file names for previews(system creates files like abc_90x90.jpg, I need to have  abc.jpg). Does anybody know, where is the code that creates previews?
Title: Re: Where is the code that creates previews?
Post by: Maxim Pishnyak on August 18, 2013, 11:18:57 AM
You could upload manually or import with the help of CSVI Improved pictures for previews.
Title: Re: Where is the code that creates previews?
Post by: borro on October 29, 2013, 13:19:08 PM
Quote from: Maxim Pishnyak on August 18, 2013, 11:18:57 AM
You could upload manually or import with the help of CSVI Improved pictures for previews.
Hello, Maxim.

When I upload many photos in "product" folder and then click synchronize photos in media files section, system generetes such previews with such suffixes. And when i need quickly replace all previews by that what are stored at my local computer there is a little problem: previews at local comp don't have any suffixes. Of course I can make a bulk rename of local photos but I don't think it's a goo idea. By the way if we decide to have a previews with another dimensions we'll need to rename our local photos again. May be I don't see all sides of situation. How do you think is it a good idea to fix virtuemart code, which generates preview names with suffixes?
Title: Re: Where is the code that creates previews?
Post by: Maxim Pishnyak on November 22, 2013, 10:03:04 AM
Status of 'Enable Dynamic Thumbnail Resizing?"?
Title: Re: Where is the code that creates previews?
Post by: borro on November 22, 2013, 10:33:34 AM
Hello, Maxim.

I've found what someone can do to get rid of suffixes. To do that in \administrator\components\com_virtuemart\helpers\image.php file in function createThumbName you need to replace this code:
$this->file_name_thumb = $this->file_name.'_'.$width.'x'.$height;
with this one:
$this->file_name_thumb = $this->file_name;

Checked on VM 2.0.18a
Title: Re: Where is the code that creates previews?
Post by: Maxim Pishnyak on November 22, 2013, 10:47:37 AM
Are you sure that you really need to hack the core? You could just turn off option that I mentioned above and setup your shop then correctly.
Title: Re: Where is the code that creates previews?
Post by: borro on November 22, 2013, 11:41:15 AM
The main idea of this check box is to control autogeneration of thumbs, isn' it? that is when this option is unchecked you need to upload a thumb manually for every added photo?
Title: Re: Where is the code that creates previews?
Post by: Maxim Pishnyak on November 22, 2013, 14:38:09 PM
Quote from: borro on November 22, 2013, 11:41:15 AM
that is when this option is unchecked you need to upload a thumb manually for every added photo?
So you could control something then.