Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Automatically Generate/ Reduce Photo Size?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 04-21-2016, 11:39 AM
 
FMF FMF is offline
 

Advanced Member
  
Join Date: Apr 2010
Posts: 77
 

Default Automatically Generate/ Reduce Photo Size?

Hi All,

I've just uploaded around 300 product images to my site and have realized that they are way too big (~600kb each).

X-cart automatically generates a new thumbnail for the search and category pages, but for the picture on the product page is still the original file, just reduced dimensions.

Is there any way to bulk reduce the dimensions of the original photo to x dimensions?

I just don't want to have to edit and re upload 300 new photos.

Thanks,
Tyler
__________________
X-Cart GoldPlus: 4.6.4
reBOOT Template
CDSEO Pro 2.0
Total Server Solutions Hosting
Reply With Quote
  #2  
Old 04-21-2016, 10:10 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Automatically Generate/ Reduce Photo Size?

Do you have http://www.imagemagick.org/ installed on the server?

If so, you can bulk-resize by calling ImageMagick with the following parameters in the directory with the images on the server:
Code:
mogrify -resize "2880x1800>" *.jpg
, where:
- 2880x1800 - are the desired maximum dimensions
- *.jpg - is the wildcard for the files to be processed by the script

If you don't have SSH access to the server (so you can't run the above command on the server), you can install ImageMagick on your local computer and run the command there (and then upload changed files to the server).
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions

Last edited by qualiteam : 04-21-2016 at 10:12 PM.
Reply With Quote
  #3  
Old 04-21-2016, 10:20 PM
 
FMF FMF is offline
 

Advanced Member
  
Join Date: Apr 2010
Posts: 77
 

Default Re: Automatically Generate/ Reduce Photo Size?

Thanks for the tip! Yeah, I totally hadn't though about just downloading the files from the /images folder, mass editing them and then reuploading them. That will save a lot of time!

Thanks,
Tyler
__________________
X-Cart GoldPlus: 4.6.4
reBOOT Template
CDSEO Pro 2.0
Total Server Solutions Hosting
Reply With Quote
  #4  
Old 04-22-2016, 07:38 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Automatically Generate/ Reduce Photo Size?

This may give you some strange results if you just upload the new images in the /images directory and replace the ones there.
XC saved in database not only the image name and location but size, dimensions, and other info. So if you just replace images the database entries will remain with old info which may not play nice with the new images.
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
qualiteam (04-22-2016)
  #5  
Old 04-26-2016, 04:31 PM
 
FMF FMF is offline
 

Advanced Member
  
Join Date: Apr 2010
Posts: 77
 

Default Re: Automatically Generate/ Reduce Photo Size?

Quote:
Originally Posted by cflsystems
This may give you some strange results if you just upload the new images in the /images directory and replace the ones there.
XC saved in database not only the image name and location but size, dimensions, and other info. So if you just replace images the database entries will remain with old info which may not play nice with the new images.

Hmm, thanks for the advice Steve. I did notice that my old dimensions still show up on the product edit pages.

As far as I can tell the layout is the same on all browsers though. Is there any easy way to get the database to re-generate those dimensions from the current images?
__________________
X-Cart GoldPlus: 4.6.4
reBOOT Template
CDSEO Pro 2.0
Total Server Solutions Hosting
Reply With Quote
  #6  
Old 04-26-2016, 05:29 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Automatically Generate/ Reduce Photo Size?

Maybe this can help - https://www.cflsystems.com/thumbnails-generator-for-x-cart-classic.html
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #7  
Old 04-26-2016, 05:44 PM
 
FMF FMF is offline
 

Advanced Member
  
Join Date: Apr 2010
Posts: 77
 

Default Re: Automatically Generate/ Reduce Photo Size?

haha, I actually purchased your thumbnail mod two years ago for another problem.

It didn't actually fix anything since the thumbnails dimensions were already okay and it doesn't seem to modify anything with the original picture dimensions. Not a big deal though as it doesn't seem to be an issue.
__________________
X-Cart GoldPlus: 4.6.4
reBOOT Template
CDSEO Pro 2.0
Total Server Solutions Hosting
Reply With Quote
  #8  
Old 04-26-2016, 05:46 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Automatically Generate/ Reduce Photo Size?

The module works with the dimensions set in admin settings so if images fall within these dimensions nothing will be modified of course. The module takes actual image dimensions not the ones written in db.
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:32 AM.

   

 
X-Cart forums © 2001-2020