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 3 4 [5] 6 7 8 9 ... 15   Go Down

Author Topic: Permanant watermark with undo possibility (GD2+IMagick)  (Read 242565 times)

0 Members and 1 Guest are viewing this topic.

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #80 on: July 19, 2005, 09:08:58 am »

OK, lol...just for you I've installed this modmod on my test machine....

it's one lil mistake. Happened cause I'm already using a modded upload php

so here you go... find in upload php

Code: [Select]
   $form_array = array(
    array($lang_upload_php['album'], 'album', 2),
    array($lang_upload_php['pic_title'], 'title', 0, 255, 1),
    array($captionLabel, 'caption', 3, $CONFIG['max_img_desc_length']),
    array($lang_upload_php['keywords'], 'keywords', 0, 255, 1),
    array('control', 'phase_2', 4),
    array('unique_ID', $_POST['unique_ID'], 4),
    );

replace with

Code: [Select]
   $form_array = array(
    array($lang_upload_php['album'], 'album', 2),
    array($lang_upload_php['pic_title'], 'title', 0, 255, 1),
    array($captionLabel, 'caption', 3, $CONFIG['max_img_desc_length']),
    array($lang_upload_php['keywords'], 'keywords', 0, 255, 1),
    array('control', 'phase_2', 4),
    array('unique_ID', $_POST['unique_ID'], 4),
    );

if (USER_IS_ADMIN) {
$form_array[] = array($lang_upload_php['disable_admin_watermark'], 'disable_admin_watermark', 5);
}

I've corrected this above as well

xb00t

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #81 on: July 21, 2005, 02:53:24 pm »

Your method works like a charm! Everything is OK and I am quite pleased with the result. ;)

Only one question. Can I apply the watermark to the already uploaded pictures?  ::)
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #82 on: July 21, 2005, 06:34:11 pm »

Your method works like a charm! Everything is OK and I am quite pleased with the result. ;)

Only one question. Can I apply the watermark to the already uploaded pictures?  ::)

yes... try the admin tools -> Update thumbs and/or resized photos -> Both normal and full sized (if a orig copy is available)
the standard coppermine function isn't that good if you have loads of pics. If you do have more then ~500 tell me and I'll post my batch modify mod

xb00t

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #83 on: July 21, 2005, 11:45:35 pm »

It seems to be working pretty fine except the fact that for some reason I cant change the CHMOD to some of my pics and CPG can't update them. It works works for some of them. @_@ The wierdest thing is that my FTP client wont change the CHMOD aswel. And I am root. ???
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #84 on: July 22, 2005, 08:28:22 am »

if you're root, you should know: CHOWN before CHMODing...
However, the root account shouldn't be used for FTPing.
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #85 on: July 22, 2005, 09:28:17 am »

However, the root account shouldn't be used for FTPing.

for security reasons you should go even further and configure root not to be able to login using ftp, ssh, ssh2 or whatever. Most secure is to use a standard user to login and then su. This way an attacker will need to break two walls

And some FTP clients have problems with chown, chmod. Use ssh, that works

Ancyru

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 5
  • L'Awesome Advocate
    • /ancyru.
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #86 on: July 23, 2005, 11:09:47 am »

There seems to be an issue with having watermarks on Resized images only. I have added this mod to an unmodified coppermine 1.3.3

It works fine if I select watermarks for both images but no watermark appears for just resized images. Any suggestions?
Logged
When I get sad, I stop being sad, and be AWESOME instead. True story.
 *Image Removed*

Ancyru

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 5
  • L'Awesome Advocate
    • /ancyru.
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #87 on: July 23, 2005, 03:23:47 pm »

Also when I select the option to watermark the originals only it watermarks the resized and original image.
Logged
When I get sad, I stop being sad, and be AWESOME instead. True story.
 *Image Removed*

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #88 on: July 24, 2005, 08:55:30 am »

you're right... thanks for mentioning it. Looks like with the last bugfix a few if statements mixed up

just replace your picmgmt.inc.php with the new one

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
hack: different watermark for users
« Reply #89 on: July 24, 2005, 10:31:42 am »

That's a lil hack for the watermark mod. If you want certain users to have their own watermark then it's for you

How to use it?
Just FTP a new watermark file into the dir where your main watermark file already is. It's name should be the username it is for. On nix boxes it's case sensitive. It has to be png.
Eg. the user you want to have an own watermark for is 'MadDog'... then the watermark file needs to be named 'MadDog.png'. When this user now uploads, that watermark will be used for his pictures. Pictures uploaded by other users will get the standard watremark. To remove special watermarks for a certain user, just delete his watermark file.

Warning: when using the admin tools to change/ modify watermarks all special watermarks will get replaced with the standard watermark. If the logged in admin has a special watermark this will be used then.

here's the new picmgmt.inc.php

Code: [Select]
<?php
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery 1.3.2                                            //
// ------------------------------------------------------------------------- //
// Copyright (C) 2002-2004 Gregory DEMAR                                     //
// http://www.chezgreg.net/coppermine/                                       //
// ------------------------------------------------------------------------- //
// Updated by the Coppermine Dev Team                                        //
// (http://coppermine.sf.net/team/)                                          //
// see /docs/credits.html for details                                        //
// ------------------------------------------------------------------------- //
// This program is free software; you can redistribute it and/or modify      //
// it under the terms of the GNU General Public License as published by      //
// the Free Software Foundation; either version 2 of the License, or         //
// (at your option) any later version.                                       //
// ------------------------------------------------------------------------- //
// CVS version: $Id: picmgmt.inc.php,v 1.8 2004/07/27 13:58:04 oddeveloper Exp $
// ------------------------------------------------------------------------- //

// Add a picture to an album
function add_picture($aid$filepath$filename$title ''$caption ''$keywords ''$user1 ''$user2 ''$user3 ''$user4 ''$category 0$raw_ip ''$hdr_ip '',$iwidth=0,$iheight=0)
{
    global 
$CONFIG$ERROR$USER_DATA$PIC_NEED_APPROVAL;
    global 
$lang_errors;

    
$image $CONFIG['fullpath'] . $filepath $filename;
    
$normal $CONFIG['fullpath'] . $filepath $CONFIG['normal_pfx'] . $filename;
    
$thumb $CONFIG['fullpath'] . $filepath $CONFIG['thumb_pfx'] . $filename;
    
$orig $CONFIG['fullpath'] . $filepath $CONFIG['orig_pfx'] . $filename;
$work_image $image;
    if (!
is_known_filetype($image)) {
        return 
false;
    } elseif (
is_image($filename)) {
if (!file_exists($orig) && $CONFIG['enable_watermark'] == '1' && ($CONFIG['which_files_to_watermark'] == 'both' || $CONFIG['which_files_to_watermark'] == 'original'))  {
// if copy of full_sized doesn't exist and if watermark enabled and if fullsized pic watermark=true -> then we need a backup
if (!copy($image$orig))
                return 
false;
else
$work_image $orig;
}
        if (!
file_exists($thumb)) {
            if (!
resize_image($work_image$thumb$CONFIG['thumb_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use'], "false"))
                return 
false;
        }
        
$imagesize getimagesize($work_image);
        if (
max($imagesize[0], $imagesize[1]) > $CONFIG['picture_width'] && $CONFIG['make_intermediate'] && !file_exists($normal)) {
            if (
$CONFIG['enable_watermark'] == '1' && $CONFIG['which_files_to_watermark'] == 'both' || $CONFIG['which_files_to_watermark'] == 'resized'){
if (!resize_image($work_image$normal$CONFIG['picture_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use'], "true"))
                
return false;
}
else {
if (!resize_image($work_image$normal$CONFIG['picture_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use'], "false"))
            return 
false;
}
}
/*else {
if (!resize_image($work_image, $normal, $CONFIG['picture_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use'], "false"))
                return false;

}*/
        
$imagesize getimagesize($work_image);
        if (
$CONFIG['enable_watermark'] == '1' && $CONFIG['which_files_to_watermark'] == 'both' || $CONFIG['which_files_to_watermark'] == 'original'){
if (!resize_image($work_image$image$imagesize[0], $CONFIG['thumb_method'], 'orig''true'))
                
return false;
}
    } else {
        
$imagesize[0] = $iwidth;
        
$imagesize[1] = $iheight;
    }


    
$image_filesize filesize($image);
    
$total_filesize is_image($filename) ? ($image_filesize + (file_exists($normal) ? filesize($normal) : 0) + filesize($thumb)) : ($image_filesize);


    
// Test if disk quota exceeded
    
if (!GALLERY_ADMIN_MODE && $USER_DATA['group_quota']) {
        
$result db_query("SELECT sum(total_filesize) FROM {$CONFIG['TABLE_PICTURES']}{$CONFIG['TABLE_ALBUMS']} WHERE  {$CONFIG['TABLE_PICTURES']}.aid = {$CONFIG['TABLE_ALBUMS']}.aid AND category = '" . (FIRST_USER_CAT USER_ID) . "'");
        
$record mysql_fetch_array($result);
        
$total_space_used $record[0];
        
mysql_free_result($result);

        if (((
$total_space_used $total_filesize)>>10) > $USER_DATA['group_quota'] ) {
            @
unlink($image);
            if (
is_image($image)) {
                @
unlink($normal);
                @
unlink($thumb);
            }
            
$msg strtr($lang_errors['quota_exceeded'], array('[quota]' => ($USER_DATA['group_quota']),
                
'[space]' => ($total_space_used >> 10)));
            
cpg_die(ERROR$msg__FILE____LINE__);
        }
    }
    
// Test if picture requires approval
    
if (GALLERY_ADMIN_MODE) {
        
$approved 'YES';
    } elseif (!
$USER_DATA['priv_upl_need_approval'] && $category == FIRST_USER_CAT USER_ID) {
        
$approved 'YES';
    } elseif (!
$USER_DATA['pub_upl_need_approval']) {
        
$approved 'YES';
    } else {
        
$approved 'NO';
    }
    
$PIC_NEED_APPROVAL = ($approved == 'NO');
    
// User ID is now recorded when in admin mode (casper)
    
$user_id USER_ID;
    
$usernameUSER_NAME;
    
$query "INSERT INTO {$CONFIG['TABLE_PICTURES']} (pid, aid, filepath, filename, filesize, total_filesize, pwidth, pheight, ctime, owner_id, owner_name, title, caption, keywords, approved, user1, user2, user3, user4, pic_raw_ip, pic_hdr_ip) VALUES ('', '$aid', '" addslashes($filepath) . "', '" addslashes($filename) . "', '$image_filesize', '$total_filesize', '{$imagesize[0]}', '{$imagesize[1]}', '" time() . "', '$user_id', '$username','$title', '$caption', '$keywords', '$approved', '$user1', '$user2', '$user3', '$user4', '$raw_ip', '$hdr_ip')";
    
$result db_query($query);

    return 
$result;
}

define("GIS_GIF"1);
define("GIS_JPG"2);
define("GIS_PNG"3);

// Add 'edit' directory if it doesn't exist
// Set access to read+write only
if (!is_dir($CONFIG['fullpath'].'edit')) {
    
$cpg_umask umask(0);
    @
mkdir($CONFIG['fullpath'].'edit',0666);
    
umask($cpg_umask);
    unset(
$cpg_umask);
}

/**
* resize_image()
*
* Create a file containing a resized image
*
* @param  $src_file the source file
* @param  $dest_file the destination file
* @param  $new_size the size of the square within which the new image must fit
* @param  $method the method used for image resizing
* @return 'true' in case of success
*/
function resize_image($src_file$dest_file$new_size$method$thumb_use$watermark="false")
{
    global 
$CONFIG$ERROR;
    global 
$lang_errors;

    if (
$watermark == "true"){
        
$path_parts pathinfo($CONFIG['watermark_file']);
        if (
file_exists($path_parts["dirname"]."/".(USER_NAME).".png")) $wm_file $path_parts["dirname"]."/".(USER_NAME).".png";
        else 
$wm_file $CONFIG['watermark_file'];
    }

    
$imginfo getimagesize($src_file);
    if (
$imginfo == null)
        return 
false;
        
// GD can only handle JPG & PNG images
    
if ($imginfo[2] != GIS_JPG && $imginfo[2] != GIS_PNG && ($method == 'gd1' || $method == 'gd2')) {
        
$ERROR $lang_errors['gd_file_type_err'];
        return 
false;
    }
    
// height/width
    
$srcWidth $imginfo[0];
    
$srcHeight $imginfo[1];
    if (
$thumb_use == 'ht') {
        
$ratio $srcHeight $new_size;
    } elseif (
$thumb_use == 'wd') {
        
$ratio $srcWidth $new_size;
    } else {
        
$ratio max($srcWidth$srcHeight) / $new_size;
    }
    
$ratio max($ratio1.0);
if ($thumb_use == 'orig'$ratio=1.0;
    
$destWidth = (int)($srcWidth $ratio);
    
$destHeight = (int)($srcHeight $ratio);
    
// Method for thumbnails creation
    
switch ($method) {
        case 
"im" :
            if (
preg_match("#[A-Z]:|\\\\#Ai"__FILE__)) {
                
// get the basedir, remove '/include'
                
$cur_dir substr(dirname(__FILE__), 0, -8);
                
$src_file '"' $cur_dir '\\' strtr($src_file'/''\\') . '"';
                
$im_dest_file str_replace('%''%%', ('"' $cur_dir '\\' strtr($dest_file'/''\\') . '"'));
            } else {
                
$src_file escapeshellarg($src_file);
                
$im_dest_file str_replace('%''%%'escapeshellarg($dest_file));
            }

            
$output = array();
$anno_txt="";
$annotate="";

            
/*
             * Hack for working with ImageMagick on WIndows even if IM is installed in C:\Program Files.
             * By Aditya Mooley <aditya@sanisoft.com>
             */

                
$cmd "{$CONFIG['impath']}convert -quality {$CONFIG['jpeg_qual']} {$CONFIG['im_options']} -geometry {$destWidth}x{$destHeight} $annotate $src_file $im_dest_file";
exec ($cmd$output$retval);
if ($watermark == "true"){
$cmd "{$CONFIG['impath']}composite -dissolve {$CONFIG['watermark_transparency']} -gravity {$CONFIG['where_put_watermark']} {$wm_file} $im_dest_file $im_dest_file";
exec ($cmd$output$retval);
            
}

            if (
$retval) {
                
$ERROR "Error executing ImageMagick - Return value: $retval";
                if (
$CONFIG['debug_mode']) {
                    
// Re-execute the command with the backtit operator in order to get all outputs
                    // will not work is safe mode is enabled
                    
$output = `$cmd 2>&1`;
                    
$ERROR .= "<br /><br /><div align=\"left\">Cmd line : <br /><font size=\"2\">" nl2br(htmlspecialchars($cmd)) . "</font></div>";
                    
$ERROR .= "<br /><br /><div align=\"left\">The convert program said:<br /><font size=\"2\">";
                    
$ERROR .= nl2br(htmlspecialchars($output));
                    
$ERROR .= "</font></div>";
                }
                @
unlink($dest_file);
                return 
false;
            }
            break;

        case 
"gd1" :
            if (!
function_exists('imagecreatefromjpeg')) {
                
cpg_die(CRITICAL_ERROR'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed'__FILE____LINE__);
            }
            if (
$imginfo[2] == GIS_JPG)
                
$src_img imagecreatefromjpeg($src_file);
            else
                
$src_img imagecreatefrompng($src_file);
            if (!
$src_img) {
                
$ERROR $lang_errors['invalid_image'];
                return 
false;
            }
            
$dst_img imagecreate($destWidth$destHeight);
            
imagecopyresized($dst_img$src_img0000$destWidth, (int)$destHeight$srcWidth$srcHeight);
            
imagejpeg($dst_img$dest_file$CONFIG['jpeg_qual']);
            
imagedestroy($src_img);
            
imagedestroy($dst_img);
            break;

        case 
"gd2" :
            if (!
function_exists('imagecreatefromjpeg')) {
                
cpg_die(CRITICAL_ERROR'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed'__FILE____LINE__);
            }
            if (!
function_exists('imagecreatetruecolor')) {
                
cpg_die(CRITICAL_ERROR'PHP running on your server does not support GD version 2.x, please switch to GD version 1.x on the config page'__FILE____LINE__);
            }
            if (
$imginfo[2] == GIS_JPG)
                
$src_img imagecreatefromjpeg($src_file);
            else
                
$src_img imagecreatefrompng($src_file);
            if (!
$src_img) {
                
$ERROR $lang_errors['invalid_image'];
                return 
false;
            }
            
$dst_img imagecreatetruecolor($destWidth$destHeight);
            
imagecopyresampled($dst_img$src_img0000$destWidth, (int)$destHeight$srcWidth$srcHeight);
            
if ($watermark == "true"){
$logoImage ImageCreateFromPNG($wm_file);
    $logoW ImageSX($logoImage); 
    $logoH ImageSY($logoImage); 
    //where is the watermark displayed...
    $pos $CONFIG['where_put_watermark']; 
if ($pos == "northwest") { 
$src_x 5;  
$src_y 5
} else if ($pos == "northeast") { 
$src_x $destWidth - ($logoW 5); 
$src_y 5
} else if ($pos == "southwest") { 
$src_x 5
$src_y $destHeight - ($logoH 5); 
} else if ($pos == "southeast") { 
$src_x $destWidth - ($logoW 5); 
$src_y $destHeight - ($logoH 5); 
} else if ($pos == "center") { 
$src_x = ($destWidth/2) - ($logoW/2); 
$src_y = ($destHeight/2) - ($logoH/2); 


// no, we don't support that in the script, overkill... just make a transparentbkg png and don't be so lazy
//imagecolortransparent($logoImage, imagecolorat($logoImage, $CONFIG['watermark_transparency_featherx'], $CONFIG['watermark_transparency_feathery']));
imagealphablending($dst_imgTRUE);
imagecolortransparent($logoImageimagecolorat($logoImage$CONFIG['watermark_transparency_featherx'], $CONFIG['watermark_transparency_feathery']));
ImageCopyMerge($dst_img,$logoImage,$src_x,$src_y,0,0,$logoW,$logoH,$CONFIG['watermark_transparency']); //$dst_x,$dst_y,0,0,$logoW,$logoH); 
}
imagejpeg($dst_img$dest_file$CONFIG['jpeg_qual']);
            
imagedestroy($src_img);
            
imagedestroy($dst_img);
            break;
    }
    
// Set mode of uploaded picture
    
chmod($dest_fileoctdec($CONFIG['default_file_mode']));
    
// We check that the image is valid
    
$imginfo getimagesize($dest_file);
    if (
$imginfo == null) {
        
$ERROR $lang_errors['resize_failed'];
        @
unlink($dest_file);
        return 
false;
    } else {
        return 
true;
    }
}
?>
« Last Edit: July 31, 2005, 07:13:21 pm by Stramm »
Logged

Ancyru

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 5
  • L'Awesome Advocate
    • /ancyru.
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #90 on: July 24, 2005, 11:20:05 am »

I have updated the new picmgmt.inc.php but it still isn't applying the watermark to the resized images on the resize only option.

[ edit | actually the new picmgmt.inc.php has made no difference ]
« Last Edit: July 24, 2005, 11:26:02 am by Ancyru »
Logged
When I get sad, I stop being sad, and be AWESOME instead. True story.
 *Image Removed*

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #91 on: July 24, 2005, 11:47:15 am »

tested again with only resized, only original, both and no watermark... works perfect. you really are using the actual version??
(I've used the version from the board to be sure it's the one it should be). In case it really doesn't work, attach your picmgm... and tell me something about your system

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
hack: better admin tool update thumbs, normal, full pictures
« Reply #92 on: July 24, 2005, 11:59:00 am »

When having a lot of pics the standard admin tools are a pain. On production boxes with a short timeout you only can process ~5 pics at a time. When done you have to click 'continue'. Doing that for a few thousand pics is annoying as hell. So here a lil hack for it.

What it does... the script simply calls itself over and over again till all images are processed. No need to click continue. Best is to set ~5 images to process at a time. If it really should time out with these only five pics just hit the browser reload button and it continues to work. So have a coffe and a lil bit of time and all's done by itself...

in util.php find
Code: [Select]
<form action="' . $phpself . '" method="post">
replace with
Code: [Select]
<form action="updatethumbs.php" method="post">
a few lines below find
Code: [Select]
   endtable();

    print '<br />';

replace with
Code: [Select]
endtable();

print '<h2>'.$lang_util_php['select_album'].'</h2>';

    if (defined('UDB_INTEGRATION')) {
        udb_util_filloptions();
    } else {
        filloptions();
    }



    print '<br />

<form action="' . $phpself . '" method="post">';


now place the attached file in your coppermine main dir

Have fun drinking your coffee
« Last Edit: August 01, 2005, 08:46:44 am by Stramm »
Logged

Ancyru

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 5
  • L'Awesome Advocate
    • /ancyru.
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #93 on: July 24, 2005, 12:42:00 pm »

The picmgmt.inc.php is exactly the same as the one you just updated.

I forgot to mention that it's working fine on the files I just upload but it's not working in admin tools to update images.
Logged
When I get sad, I stop being sad, and be AWESOME instead. True story.
 *Image Removed*

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #94 on: July 24, 2005, 02:12:30 pm »

you should have mentioned that before :)

OK, either update 'function updatethumbs()' or apply the better admin tool hack for updating thumbs, normal and full images

if you stumble over some more bugs... you know where I am, hehehe

edit: I'm using the above mentioned hack... so I wasn't able to test the standard function. But the hack works smooth for me
« Last Edit: July 24, 2005, 02:18:11 pm by Stramm »
Logged

Ancyru

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 5
  • L'Awesome Advocate
    • /ancyru.
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #95 on: July 24, 2005, 02:16:31 pm »

Sweet, everything is working fine now!

Cheers mate,
` anCyru
Logged
When I get sad, I stop being sad, and be AWESOME instead. True story.
 *Image Removed*

freesouljah

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 116
  • Can you feel the Love?
    • freesouljah.com
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #96 on: July 31, 2005, 06:18:49 am »

OK, lol...just for you I've installed this modmod on my test machine....

it's one lil mistake. Happened cause I'm already using a modded upload php

so here you go... find in upload php

Code: [Select]
    $form_array = array(
    array($lang_upload_php['album'], 'album', 2),
    array($lang_upload_php['pic_title'], 'title', 0, 255, 1),
    array($captionLabel, 'caption', 3, $CONFIG['max_img_desc_length']),
    array($lang_upload_php['keywords'], 'keywords', 0, 255, 1),
    array('control', 'phase_2', 4),
    array('unique_ID', $_POST['unique_ID'], 4),
    );

replace with

Code: [Select]
    $form_array = array(
    array($lang_upload_php['album'], 'album', 2),
    array($lang_upload_php['pic_title'], 'title', 0, 255, 1),
    array($captionLabel, 'caption', 3, $CONFIG['max_img_desc_length']),
    array($lang_upload_php['keywords'], 'keywords', 0, 255, 1),
    array('control', 'phase_2', 4),
    array('unique_ID', $_POST['unique_ID'], 4),
    );

if (USER_IS_ADMIN) {
$form_array[] = array($lang_upload_php['disable_admin_watermark'], 'disable_admin_watermark', 5);
}

I've corrected this above as well




I get this error now:

Quote
Parse error: parse error, unexpected ',' in /home/staticp/public_html/photos/upload.php on line 923

this may be due to a mod that I have installed in that area...
here is what I have:

Code: [Select]
        // Declare an array containing the various upload form box definitions.
        $captionLabel = $lang_upload_php['description'];
        if ($CONFIG['show_bbcode_help']) {$captionLabel .= '<hr />'.$lang_bbcode_help;}
        $form_array = array(
        sprintf($lang_upload_php['max_fsize'], $CONFIG['max_upl_size']),
        array($lang_upload_php['album'], 'album', 2),
        array('MAX_FILE_SIZE', $max_file_size, 4),
        array($lang_upload_php['picture'], 'userpicture', 1, 1),
        array($lang_upload_php['pic_title'], 'title', 0, 255, 1),
        array($captionLabel, 'caption', 3, $CONFIG['max_img_desc_length']),
        array($lang_upload_php['keywords'], 'keywords', 0, 255, 1));
        array('event', 'picture', 4),                                                        <----------------- line 923

if (USER_IS_ADMIN) {
$form_array[] = array($lang_upload_php['disable_admin_watermark'], 'disable_admin_watermark', 5);
}

        );


sorry for all the trouble  ???

also...I have noticed that sometimes the quality of the original image is crummy (it appears that the normal sized version has just been stretched out and then watermarked at a larger size)...this doesn't always happens, so I don't know if it is because of server load or what...


thanks
« Last Edit: July 31, 2005, 07:15:40 am by freesouljah »
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #97 on: July 31, 2005, 09:56:34 am »

change
Code: [Select]
array($lang_upload_php['keywords'], 'keywords', 0, 255, 1));to
Code: [Select]
array($lang_upload_php['keywords'], 'keywords', 0, 255, 1),
with the ); at the end you're closing the array definition but continue in the next line with it
then as it looks that will just correct the error message you have now. Another one will show up.

The code should read...
Code: [Select]
        array($lang_upload_php['keywords'], 'keywords', 0, 255, 1),
        array('event', 'picture', 4));

if (USER_IS_ADMIN) {
$form_array[] = array($lang_upload_php['disable_admin_watermark'], 'disable_admin_watermark', 5);
}


the pic quality stuff that sometimes happens. It's the downside of having to recompress the images. Hasn't to do anything with the load. But if you want you can email me a pic (original for sure) and I'll have a look

But I really can't give you support with other mods
The above stuff's just obvious ;)

freesouljah

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 116
  • Can you feel the Love?
    • freesouljah.com
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #98 on: July 31, 2005, 04:10:19 pm »

change
Code: [Select]
array($lang_upload_php['keywords'], 'keywords', 0, 255, 1));to
Code: [Select]
array($lang_upload_php['keywords'], 'keywords', 0, 255, 1),
with the ); at the end you're closing the array definition but continue in the next line with it
then as it looks that will just correct the error message you have now. Another one will show up.

The code should read...
Code: [Select]
        array($lang_upload_php['keywords'], 'keywords', 0, 255, 1),
        array('event', 'picture', 4));

if (USER_IS_ADMIN) {
$form_array[] = array($lang_upload_php['disable_admin_watermark'], 'disable_admin_watermark', 5);
}


the pic quality stuff that sometimes happens. It's the downside of having to recompress the images. Hasn't to do anything with the load. But if you want you can email me a pic (original for sure) and I'll have a look

But I really can't give you support with other mods
The above stuff's just obvious ;)

cool  8)

that fixed the problem....thanks :D

on the image problem it seems to not be a problem in small batches...so for now I will use the util to fix the quality issues...but if you still want to see the image quality probs, I can post up examples for you...


on your util.php mod I get this error when I try to process the images:

Quote
Parse error: parse error, unexpected $ in /home/staticp/public_html/photos/updatethumbs.php on line 160

freesouljah

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 116
  • Can you feel the Love?
    • freesouljah.com
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #99 on: July 31, 2005, 04:23:48 pm »

 ???

it seems the image quality issue isn't as predictable as I thought....I just did a batch of over 100 images, and they all seemed to turn out fine...but when I went through using util.php to try to fix the issues on another batch that had the image degredation, nothing happened...

here are two pics showing the problem I am encountering:
Pages: 1 2 3 4 [5] 6 7 8 9 ... 15   Go Up
 

Page created in 0.051 seconds with 22 queries.