News:

Support the VirtueMart project and become a member

Main Menu

Where is the code that creates previews?

Started by borro, August 17, 2013, 10:12:22 AM

Previous topic - Next topic

borro

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?
Wish you happiness!

Maxim Pishnyak

You could upload manually or import with the help of CSVI Improved pictures for previews.
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

borro

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?
Wish you happiness!

Maxim Pishnyak

Status of 'Enable Dynamic Thumbnail Resizing?"?
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

borro

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
Wish you happiness!

Maxim Pishnyak

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.
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

borro

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?
Wish you happiness!

Maxim Pishnyak

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.
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart