delete thumbs and update thumbs an resized images automatically? delete thumbs and update thumbs an resized images automatically?
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

delete thumbs and update thumbs an resized images automatically?

Started by alexandre596, March 26, 2012, 01:19:29 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

alexandre596

I don't even know if it's possible..

well, everytime everybody upload a picture, the thumb and the resized pictures won't be watermaked , the full-size will be, and the original one (the one without watermark) will remain on the server, right?

I wanted to watermark the thumbnail and the resized picture too, and delete that original picture as well just after the picture get in my coppermine gallery...

Everytime I upload a picute I have to go to Admin Tools (or something like that, mine coppermine is not english), and check that option to delete the original picture, and after that is done, I go to that option to update the thumbs and the resized images on my album

is there any plugin to do all this automatically after I upload the pictures??


ΑndrĂ©

To apply the watermark to the intermediate-sized pictures, just set it accordingly in the config: http://documentation.coppermine-gallery.net/en/configuration.htm#admin_watermarking_filetype

To apply the watermark to the thumbnails there's a mod if I remember correctly. The following mod may work, but I haven't checked that. Open include/picmgmt.inc.php, find
if (($result = resize_image($work_image, $thumb, $CONFIG['thumb_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use'], "false", 1)) !== true) {
and replace with
if (($result = resize_image($work_image, $thumb, $CONFIG['thumb_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use'], "true", 1)) !== true) {

Instead of deleting the backup files we can modify the code, so it won't create them at all. Open include/picmgmt.inc.php, find
        // create backup of full sized picture if watermark is enabled for full sized pictures
        if (!file_exists($orig) && $CONFIG['enable_watermark'] == '1' && ($CONFIG['which_files_to_watermark'] == 'both' || $CONFIG['which_files_to_watermark'] == 'original'))  {
            if (!copy($image, $orig)) {
                return false;
            } else {
                $work_image = $orig;
            }
        }

and delete the whole block.

alexandre596

sorry for don't reply, I was waiting for an email, or something

well, I've got what I wanted, but in a different way

I deleted that thing about creating the original, and then, I found on that code, where the watermark thing is


        // watermark full sized picture
        if ($CONFIG['enable_watermark'] == '1' && ($CONFIG['which_files_to_watermark'] == 'both' || $CONFIG['which_files_to_watermark'] == 'original')) {
            $wm_max_upl_width_height = $picture_original_size ? max($imagesize[0], $imagesize[1]) : $CONFIG['max_upl_width_height']; // use max aspect of original image if it hasn't been resized earlier
            if (($result = resize_image($work_image, $image, $wm_max_upl_width_height, $CONFIG['thumb_method'], 'any', 'true')) !== true) {
                return $result;
            }
        }
    } else {
        $imagesize[0] = $iwidth;
        $imagesize[1] = $iheight;
    }


so, I moved the creating thumbs and intermadiate pictures after it, not before as it used to be, and now it do exactly what I want it to do

thank you so much ;D