Please upgrade here. These earlier versions are no longer being updated and have security issues.

Image compression

This discussion is related to the ImageUpload addon.

How can I remove the image compression? I guess that problem is in the file ImageUpload/js/plupload.full.js, but i don't know how to fix it.

(Sorry, my English is bad)

Comments

  • BleistivtBleistivt MVP
    edited December 2014

    You could change the config setting

    $Configuration['Garden']['UploadImage']['Quality']

    (range: 0 - 100, default: 75)
    That would affect avatars and other images uploaded throught the forum too.

    Or you could edit line 51 in class.imageupload.plugin.php to

    $Props = $UploadImage->SaveImageAs($TmpImage,$TargetImage,C('Plugins.UploadImage.MaxHeight',''),C('Plugins.UploadImage.MaxWidth',650), array('ImageQuality' => 100));
    

    My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations

    • Vanilla APP » Learn more «
    • iOS & Android App for Vanilla - White label app for your forum
    vrijvlinderR_J
  • peregrineperegrine MVP
    edited December 2014

    don't put 100 it will break things IIRC 100 and png upload was a bug in core.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

    vrijvlinderR_JBleistivt
  • peregrineperegrine MVP
    edited December 2014

    @peregrine said:
    don't put 100 it will break things IIRC 100 and png upload was a bug in core.

    just noticed it was fixed in the master.

    with 100 in vanilla 2.1 - you will not even be able to upload png files.
    $Configuration['Garden']['UploadImage']['Quality'] = "100";

    and the png logic is actually reversed in 2.1 (wrong)

    the lower the number in $Configuration['Garden']['UploadImage']['Quality']
    causes png files to be LESS compressed, not more compressed as expected, but the quality stays the same.

    at the same time saveas may be less efficient compression than the original image, and actually result in a larger image file, even with the fix.

    here is the fix:

    https://github.com/vanilla/vanilla/blob/master/library/core/class.uploadimage.php#L245

    and some better checking:

    https://github.com/vanilla/vanilla/blob/master/library/core/class.uploadimage.php#L117

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

    Bleistivt
Sign In or Register to comment.