Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: delete thumbs and update thumbs an resized images automatically?  (Read 2540 times)

0 Members and 1 Guest are viewing this topic.

alexandre596

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 34

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??

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: delete thumbs and update thumbs an resized images automatically?
« Reply #1 on: March 26, 2012, 02:16:02 pm »

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
Code: [Select]
if (($result = resize_image($work_image, $thumb, $CONFIG['thumb_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use'], "false", 1)) !== true) {and replace with
Code: [Select]
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
Code: [Select]
        // 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.
Logged

alexandre596

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 34
Re: delete thumbs and update thumbs an resized images automatically?
« Reply #2 on: April 05, 2012, 09:56:50 pm »

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


Code: [Select]
        // 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
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 19 queries.