Bulk watermarking

turnbulm

Joined: 2004-10-03
Posts: 431
Posted: Wed, 2004-10-27 09:46

First, please feel free to tell me this is obvious/not coming until later/answered elsewhere/in the FAQ/whatever - I've looked but I can't find it!

Is it possible to watermark a batch of images at the same time? I have a few galleries already uploaded, and now want to go back and apply a copyright watermark to every resized image. The only way I can see to do this is to edit each photo individually.

Also with watermarking, I've noticed that the transparency in my watermark (it's a PNG-24 with dithered transparency) is being ignored. I just get a block watermark on a black background overlaying the image. Is this something to do with the image toolkit I'm using (GD), and if so does anyone know if either of the other options supports this?

TIA,

Matt.

 
baschny
baschny's picture

Joined: 2003-01-04
Posts: 328
Posted: Wed, 2004-10-27 12:12

turnbulm, I suspect that currently there is no way to retro-apply a watermark to an existing album.. But I think this should be easy to add (something like the "Recreate thumbnail" in the album settings). Could you post a feature request so we (and you) can track this task?

About the transparency.. Do you have ImageMagick installed, and if yes, can you test if it works with IM? Just deactivate the GD module and activate IM...

Can you send me the watermarking .png file you are using (an url to the file is enough) so I can test this out a bit? Thanks!

 
baschny
baschny's picture

Joined: 2003-01-04
Posts: 328
Posted: Wed, 2004-10-27 15:13

turnbulm, I've got your png, but I don't see any transparency information on it. You can see that in your own gallery where you uploaded the file: Even with firefox I see the black box around the image: And Firefox would have honored the transparency if there were one. Could you check this? Maybe you could provide me a direct link to the original file, and not one already in gallery?

 
turnbulm

Joined: 2004-10-03
Posts: 431
Posted: Wed, 2004-10-27 15:29

baschny, my fault - I forgot to grant "view original" on that item :oops:. I've just checked it again as guest and I can now see it with the correct transparency. Also, I've linked it for direct download at http://www.messagescan.net/c_2004_320_landscape.png

 
turnbulm

Joined: 2004-10-03
Posts: 431
Posted: Wed, 2004-10-27 17:06

Update: As baschny suggested, I have tried another imaging library instead of GD. The initial plan was to use ImageMagick, but I kept getting "UnableToAccessConfigureFile" errors out of it, and wasn't patient enough to try to solve them. Hence I went with the Gallery pre-compiled NetPBM/JHead option instead.

The outcome is that with the NetPBM toolkit I don't have the same problem with dithered transparencies in PNG-24 watermarks, so I guess it is just a GD limitation.

BTW - if anyone else has solved the IM problem I'd be intrigued to know the solution :wink:

 
baschny
baschny's picture

Joined: 2003-01-04
Posts: 328
Posted: Wed, 2004-10-27 18:08

turnbulm, I have found some further steps required on GD to maintain the png-alpha-transparency, but haven't had time yet to include support for it. Another limitation of this is that this will require PHP 4.3.2 or later.

When do you get the "UnableToAccessConfigureFile" error? I don't think I have ever seen this, could you provide more details, e.g. what steps do you do to get to this error?

 
turnbulm

Joined: 2004-10-03
Posts: 431
Posted: Wed, 2004-10-27 20:18

baschny, nice to know that GD will handle the PNGs, but I'm not worried now I have it through NetPBM. Heck, it works so I'm happy!

I had to do some investigation to discover the IM error. The "test" button in the IM module configuration page just returns "Problem executing binary:", so I added a little in the testBinaries function to show the command that was being executed (it was "/usr/bin/identfy /path/to/test.gif").

I ran that command from the shell (both as root and as the web server user) and the "UnableToAccessConfigureFile" error came back both times. It looks like IM was trying to access some kind of per-user configuration file (for root it was /root/.magick/config.mgk).

 
littletechgirl
littletechgirl's picture

Joined: 2005-03-15
Posts: 53
Posted: Tue, 2005-07-05 16:46

Hey Turnbulm, did you ever find a way to retro-watermark all of your images? I now need to do this.

Thanks!

Kris

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-07-05 17:23

littletechgirl, such a feature is not yet part of G2.

 
littletechgirl
littletechgirl's picture

Joined: 2005-03-15
Posts: 53
Posted: Tue, 2005-07-05 18:26
valiant wrote:
littletechgirl, such a feature is not yet part of G2.

Thanks for the quick reply! I know turnbulm is a coder so I was just hoping that he had written something by now. ;)

Kris

 
DanDaMan

Joined: 2006-11-30
Posts: 1
Posted: Thu, 2006-11-30 05:33

If you're not afraid to get your hands dirty, it is doable in Gallery 2.1. Yes, it requires database knowledge.

If your image has a watermark, it will have the watermark data in the 'g_postFilterOperations' field of the 'g2_Derivative' database. It will start with 'composite|plugins_data/modules/watermark/' and ends witih a ';' or the end of the field. Basically, you must put that in each DerivativeItem that you want to have a watermark.

Now there's two things that you need to clear out to get it shown. First, you must go into Gallery Maintenance Tasks and clear the database cache. Then, you need to clear out the file cache in your data directory. Once you do that, you will start getting watermarks on everything.

If you don't follow all that, just keep learning.

Dan "da Man"

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2006-11-30 16:37

g2.2 has built-in bulk watermarking. no needs to hack stuff together.

nightly snapshots of g2.2 can be downloaded from the downloads -> nightly snapshots.