• Purchasing a license grants permission to use the software and to get Tech Support. A license purchase doesn't grant customization support.

Resizing/Converting

mikez

Network license
License owner
1 ) I want to figure how to resize images on upload.

My site is a marketplace forum and sellers will upload images to post in their sale threads. There's no need to have gigantic images so I want to restrict size incase some users upload huge images.

Is there a way to limit size, something like 1600 x 1200? Anything larger gets resized down.

2) I want to convert all images to jpg. how can I do that?

Thanks in advanced.
 

mikez

Network license
License owner
because png are huge files and offer no better quality than a jpg. I don't want to store png's, but I don't want to restrict them either. If they could be converted to jpg it would save 60-65% of disk space.
 

Rodolfo

Chevereto creator
Chevereto Staff
For any reason you want to conver X to JPG you can achieve it by adding conditional in class.upload.php file. Chevereto includes an image convertor.

Go to app/lib/classes/class.upload.php and replace this:

PHP:
        // BMP?
        if($this->source_image_fileinfo['extension'] == 'bmp') {
            $this->ImageConvert = new ImageConvert($this->downstream, "png", $this->downstream);
            $this->downstream = $this->ImageConvert->out;
            $this->source_image_fileinfo = G\get_image_fileinfo($this->downstream);
        }

To this:
PHP:
        if($this->source_image_fileinfo['extension'] !== 'jpg') {
            $this->ImageConvert = new ImageConvert($this->downstream, "jpg", $this->downstream);
            $this->downstream = $this->ImageConvert->out;
            $this->source_image_fileinfo = G\get_image_fileinfo($this->downstream);
        }
 

Rodolfo

Chevereto creator
Chevereto Staff
Resizing is more complicated, you need to get rid of the image resize on upload and then force client resize at app/lib/chevereto.js.
 
Top