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 [2]   Go Down

Author Topic: Coppermine creating Orig files, Watermark not enabled?  (Read 19855 times)

0 Members and 1 Guest are viewing this topic.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Coppermine creating Orig files, Watermark not enabled?
« Reply #20 on: August 28, 2013, 09:28:08 am »

In util.php, replace the whole function deletebackup_img with
Code: [Select]
function deletebackup_img()
{
    global $CONFIG, $lang_util_php;

    $superCage = Inspekt::makeSuperCage();

    if ($superCage->post->keyExists('albumid')) {
        $albumid = $superCage->post->getInt('albumid');
    } else {
        $albumid = 0;
    }

    $albstr = $albumid ? "WHERE aid = $albumid" : '';

    $result = cpg_db_query("SELECT filepath, filename FROM {$CONFIG['TABLE_PICTURES']} $albstr");

    $i = 0;

    while ( ($row = mysql_fetch_assoc($result)) ) {

        $back = $CONFIG['fullpath'] . $row['filepath'] . $CONFIG['orig_pfx'] . $row['filename'];

        if (file_exists($back)) {
            if (unlink($back)) {
                printf($lang_util_php['del_orig'], $back);
            } else {
                printf($lang_util_php['del_error'], $back);
            }
            $i++;
            echo '<br />';
        } else {
            // don't flood the admin with such messages
            // printf($lang_util_php['error_not_found'], $back);
        }
    }

    echo '<br />';
    printf($lang_util_php['affected_records'], $i);
    echo '<br />';

    mysql_free_result($result);
}
Logged

Niecher

  • LocalSupporter
  • Coppermine frequent poster
  • ***
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 191
Re: Coppermine creating Orig files, Watermark not enabled?
« Reply #21 on: August 28, 2013, 01:00:55 pm »

Thank you very much André, now it's all perfectly.

Code: [Select]
0 affected records.

Best Regards
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Coppermine creating Orig files, Watermark not enabled?
« Reply #22 on: August 28, 2013, 01:18:43 pm »

Have you also tested the "Update thumbs and/or resized photos" option for any unexpected behavior?
Logged

Niecher

  • LocalSupporter
  • Coppermine frequent poster
  • ***
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 191
Re: Coppermine creating Orig files, Watermark not enabled?
« Reply #23 on: August 28, 2013, 02:26:36 pm »

Have you also tested the "Update thumbs and/or resized photos" option for any unexpected behavior?

Exactly

Yesterday when I was testing this code "here" and this one "here" then later I checked "Everything: full-sized, resized and thumbs" and files "orig_" are no longer created.

With the latest code shown above the list of files is also deleted:
In util.php, replace the whole function deletebackup_img with

Now the files "orig_" after disable the watermark are not created when a file is uploaded or when using "Update thumbs and / or resized photos"

Regards and thank you very much.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Coppermine creating Orig files, Watermark not enabled?
« Reply #24 on: August 28, 2013, 05:00:55 pm »

Code committed in SVN revision 8581.
Logged
Pages: 1 [2]   Go Up
 

Page created in 0.258 seconds with 20 queries.