[Skip to main content](#vessel-content)

#   Convert product images

##

- **[bp54](/forum/user/33970-bp54 "View bp54's Profile")**
- [![bp54's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33970-bp54 "View bp54's Profile") Topic Author
- [ Offline](/forum/user/33970-bp54)

Less More

- Posts: 80
- Thank you received: 8
-
-
-
-

11 years 10 months ago [\#185419](#185419) by [bp54](/forum/user/33970-bp54 "View bp54's Profile")  *[Convert product images](/forum/32-content-creation/874041-convert-product-images#185419 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.5 -- Browser(s) name and version -- : Chrome -- Error-message(debug-mod must be tuned on) -- : No error  Hi,  My customer has by mistake created a lot of product images as PNG files. You will understand what this means for the resulting size of the website so I would convert these files to JPG.  I came to the following actionplan;  1. Create a full backup of the site. 2. Copy all PNG images from ‘public&#95;html/media/com&#95;hikashop/upload’ to local PC. 3. Convert (in a batch) all PNG files to JPG files. 4. Copy the JPG files to ‘public&#95;html/media/com&#95;hikashop/upload’ 5. In the databasetable #&#95;&#95;hikashop-file, in the column file&#95;name change every file extension PNG to JPG after checking if the filename has been converted in step 3. 6. Check in the site frontend if all images are shown. 7. From the folder ‘public&#95;html/media/com&#95;hikashop/upload’ remove all files with the PNG extension. 8. From the folder ‘public&#95;html/media/com&#95;hikashop/upload’ remove all folders with ‘thumbnail’ in the name. (As far as I found, these are all created automagicaly when used;) 9. Again, verify in the frontend if all images are shown. 10. Create a full backup of the site.  I would appriciate if you could verify the planned actions and correct me where I am wrong.  Regards,  Benny.")* was created by *[bp54](/forum/user/33970-bp54 "View bp54's Profile")*

-- HikaShop version -- : 2.3.4
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.5
-- Browser(s) name and version -- : Chrome
-- Error-message(debug-mod must be tuned on) -- : No error

Hi,

My customer has by mistake created a lot of product images as PNG files. You will understand what this means for the resulting size of the website so I would convert these files to JPG.

I came to the following actionplan;

1. Create a full backup of the site.
2. Copy all PNG images from ‘public_html/media/com_hikashop/upload’ to local PC.
3. Convert (in a batch) all PNG files to JPG files.
4. Copy the JPG files to ‘public_html/media/com_hikashop/upload’
5. In the databasetable #__hikashop-file, in the column file_name change every file extension PNG to JPG after checking if the filename has been converted in step 3.
6. Check in the site frontend if all images are shown.
7. From the folder ‘public_html/media/com_hikashop/upload’ remove all files with the PNG extension.
8. From the folder ‘public_html/media/com_hikashop/upload’ remove all folders with ‘thumbnail’ in the name. (As far as I found, these are all created automagicaly when used;)
9. Again, verify in the frontend if all images are shown.
10. Create a full backup of the site.

I would appriciate if you could verify the planned actions and correct me where I am wrong.

Regards,

Benny.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vODc0MDQxLWNvbnZlcnQtcHJvZHVjdC1pbWFnZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[korzo](/forum/user/34428-korzo "View korzo's Profile")**
- [![korzo's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar34428.png)](/forum/user/34428-korzo "View korzo's Profile")
- [ Offline](/forum/user/34428-korzo)

Less More

- Posts: 193
- Thank you received: 76
-
-

11 years 10 months ago [\#185442](#185442) by [korzo](/forum/user/34428-korzo "View korzo's Profile")  Replied by *[korzo](/forum/user/34428-korzo "View korzo's Profile")* on topic *[Convert product images](/forum/32-content-creation/874041-convert-product-images#185442 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.5 -- Browser(s) name and version -- : Chrome -- Error-message(debug-mod must be tuned on) -- : No error  Hi,  My customer has by mistake created a lot of product images as PNG files. You will understand what this means for the resulting size of the website so I would convert these files to JPG.  I came to the following actionplan;  1. Create a full backup of the site. 2. Copy all PNG images from ‘public&#95;html/media/com&#95;hikashop/upload’ to local PC. 3. Convert (in a batch) all PNG files to JPG files. 4. Copy the JPG files to ‘public&#95;html/media/com&#95;hikashop/upload’ 5. In the databasetable #&#95;&#95;hikashop-file, in the column file&#95;name change every file extension PNG to JPG after checking if the filename has been converted in step 3. 6. Check in the site frontend if all images are shown. 7. From the folder ‘public&#95;html/media/com&#95;hikashop/upload’ remove all files with the PNG extension. 8. From the folder ‘public&#95;html/media/com&#95;hikashop/upload’ remove all folders with ‘thumbnail’ in the name. (As far as I found, these are all created automagicaly when used;) 9. Again, verify in the frontend if all images are shown. 10. Create a full backup of the site.  I would appriciate if you could verify the planned actions and correct me where I am wrong.  Regards,  Benny.")*

5. Wrong. Column name is file_path (file name in upload folder) not file_name(alt attribute for &lt;img&gt; tag).
There are several ways to update all files extensions in this table:
- SQL UPDATE command
- backup table, open backup file in editor, search-replace .png-&gt;.jpg, save, import it back. Make sure that your editor handle UTF-8 encoding correctly.
- Export products to csv file, open it in Excel, replace extensions in column images, import it back using Mass action. You can also use Import CSV interface, but it will change product_created date for all products to current date.

6. Delete all thumbnails, then browse all products in administration. If image is missing, Hikashop will display warning. This works only for first image. If your products have more images, you can't rely on this. If you know PHP or Javascript, it will be trivial to write simple script to verify no image is missing/redundant.

The following user(s) said Thank You: [bp54](/forum/user/33970-bp54 "View bp54's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vODc0MDQxLWNvbnZlcnQtcHJvZHVjdC1pbWFnZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bp54](/forum/user/33970-bp54 "View bp54's Profile")**
- [![bp54's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33970-bp54 "View bp54's Profile") Topic Author
- [ Offline](/forum/user/33970-bp54)

Less More

- Posts: 80
- Thank you received: 8
-
-
-
-

11 years 10 months ago [\#185453](#185453) by [bp54](/forum/user/33970-bp54 "View bp54's Profile")  Replied by *[bp54](/forum/user/33970-bp54 "View bp54's Profile")* on topic *[Convert product images](/forum/32-content-creation/874041-convert-product-images#185453 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.5 -- Browser(s) name and version -- : Chrome -- Error-message(debug-mod must be tuned on) -- : No error  Hi,  My customer has by mistake created a lot of product images as PNG files. You will understand what this means for the resulting size of the website so I would convert these files to JPG.  I came to the following actionplan;  1. Create a full backup of the site. 2. Copy all PNG images from ‘public&#95;html/media/com&#95;hikashop/upload’ to local PC. 3. Convert (in a batch) all PNG files to JPG files. 4. Copy the JPG files to ‘public&#95;html/media/com&#95;hikashop/upload’ 5. In the databasetable #&#95;&#95;hikashop-file, in the column file&#95;name change every file extension PNG to JPG after checking if the filename has been converted in step 3. 6. Check in the site frontend if all images are shown. 7. From the folder ‘public&#95;html/media/com&#95;hikashop/upload’ remove all files with the PNG extension. 8. From the folder ‘public&#95;html/media/com&#95;hikashop/upload’ remove all folders with ‘thumbnail’ in the name. (As far as I found, these are all created automagicaly when used;) 9. Again, verify in the frontend if all images are shown. 10. Create a full backup of the site.  I would appriciate if you could verify the planned actions and correct me where I am wrong.  Regards,  Benny.")*

Thank you so much Korzo for checking the actionplan and your advise.
Regards, Benny.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vODc0MDQxLWNvbnZlcnQtcHJvZHVjdC1pbWFnZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.045 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
