Skip to main content

when I upload images to the product hikashop changes the name

More
7 years 11 months ago #301009 by motocasionweb
-- url of the page with the problem -- : www.indianmotos.es/pruebamotocasion/
-- HikaShop version -- : 4.0.1
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.3.29

Hi! I've just realize that when I upload images to the product hikashop changes the name adding numbers at the end.
For example:
my image's name before upload: moto.jpg,
my image's name after upload : moto_17502633.jpg

I would like the name of the image not to be modified. It's that possible?

Thanks.

Best regards.

Please Log in or Create an account to join the conversation.

More
7 years 11 months ago #301011 by Jerome
Hello,

If HikaShop modify the name of the file, it means that you already have a file with that name in the upload folder.
HikaShop avoid the replacement/deletion of the existing image since that image is already used by other products (or category..)

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
The following user(s) said Thank You: motocasionweb

Please Log in or Create an account to join the conversation.

More
2 weeks 1 day ago #100000231 by oxido
Hikashop is not immune to this issue with WebP images.
If a user uploads two images for two different products while the "Generate WebP images" option is enabled, the filename is preserved.
Example involving two different products:
Product 1 has the image `c1.jpg`.
Product 2 has the image `c1.png`.
Both will display the same image, `c1.webp`; the visible image will be that of the last product uploaded.

Yes, I know this is an issue for lazy people who can't be bothered to give the uploaded file a proper name; I actually ran into this myself—a site administrator named several book covers "c1" and "c2" for many books.
I’ve informed them that they need to include the book title in the image filenames, but I thought it would be good for you to be aware of the situation.

Please Log in or Create an account to join the conversation.

More
2 weeks 1 day ago #100000234 by nicolas
Hi,

Thank you for the report, you are right. When "Generate WebP images" is on, HikaShop makes the WebP copy of an image by replacing its extension with .webp, so c1.jpg and c1.png both get the same c1.webp copy (in the thumbnails folders), and whichever of the two images had its thumbnails made last is the one shown for both products by the browsers that use WebP.

We have changed this so that the copy is named after the whole name of the image (c1.jpg.webp and c1.png.webp), which keeps them apart whatever names are given to the images. The same goes for the AVIF copies. The change has been added on our end. In order to get it, download again the install package of the 6.7.0 on our website and install it on your website. After updating, the new copies are made automatically the next time the images are displayed, there is nothing to set.

Until then, giving the images different names, as you asked the administrator to do, avoids the problem. For the images that already clash, rename one of them and then delete the folder images/com_hikashop/upload/thumbnails (HikaShop recreates the thumbnails and their WebP copies on the next display), otherwise the old c1.webp copy keeps being shown.

Finally, note that in order to improve SEO, it's better to have descriptive filenames for the images, so your client should really avoid c1.png-like filenames. It's more work, but it's worth it.
The following user(s) said Thank You: oxido

Please Log in or Create an account to join the conversation.

Time to create page: 0.101 seconds
Powered by Kunena Forum