Skip to content

watermark quality #19

@voii

Description

@voii

at writeWatermark function, with current stock function watermark image has bad quality, but base image is good. This is fix:

instead

        //Set image
        if(!$image_save_func($baseImage, $this->tmpfile)){
            throw new Exception("Cannot save file ".$this->tmpfile);
        }

I replaced with

        //Set image
		$img_quality = '';
        if($image_save_func == "ImageJPEG"){ $img_quality = 100; }
		if($image_save_func == 'ImagePNG'){ $img_quality = 9; }
		
        if(!$image_save_func($baseImage, $this->tmpfile, $img_quality)){
            throw new Exception("Cannot save file ".$this->tmpfile);
        }

Now watermark is good quality. Only I dont know how will it work with gif

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions