Coppermine creating Orig files, Watermark not enabled? - Page 2 Coppermine creating Orig files, Watermark not enabled? - Page 2
 

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]

Main Menu

Coppermine creating Orig files, Watermark not enabled?

Started by danvonerich, July 14, 2012, 05:27:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Αndré

In util.php, replace the whole function deletebackup_img with
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);
}

Niecher

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


0 affected records.


Best Regards

Αndré

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

Niecher

Quote from: Αndré on August 28, 2013, 01:18:43 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:
Quote from: Αndré on August 28, 2013, 09:28:08 AM
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.

Αndré