watermarking

RogerC

Joined: 2003-09-13
Posts: 13
Posted: Tue, 2004-02-17 05:29

Well, ok, I've proven to yet another group of people that I'm an idiot. I messed up the mod in Album.php, just a typo, and that caused the trouble with basedir that I was seeing in my httpd log.

But it's still not working. I'm seeing pictures, but no watermark. It's failing silently, now, though. I only know how to check the apache logs, access and error. Anywhere else i should be looking? thanks.

Roger

 
mfranz

Joined: 2004-02-11
Posts: 9
Posted: Thu, 2004-02-19 19:57

Does anyone have the pfb and enc files needed for the text watermarking?

 
rizzay

Joined: 2003-07-25
Posts: 36
Posted: Sun, 2004-02-22 03:37

Hey everyone. I recently updated to the latest version of Gallery but now all I get is red X's on the full sized images when I turn on watermarking. Anyone experienced this before or have a fix for it?

My site is located at http://photos.rizzay.com

Thanks,
Mark

 
au

Joined: 2004-02-23
Posts: 2
Posted: Mon, 2004-02-23 16:11

rayster, I had the same problem, when caching switched on.

instead of commenting out that line (which eventually would switch off caching, wouldn't it?), I moved following two lines:

// get the file we want to watermark
$file = $gallery->app->albumDir . $image_file;

to appear before this one:

$cache_file = $file . $watermarked_suffix;

now everything works, when caching switched on, too.

cheers,
Au

 
rizzay

Joined: 2003-07-25
Posts: 36
Posted: Wed, 2004-02-25 22:01

Hey everyone...now i see something even more strange since i've installed the watermark code. Most of my thumbs turn out ok but the resized and full size pictures show the 'X' - Until i hit relead! then the pictures appear!! Does anyone have a clue why this would happen.... If code would help i will gladly send it.

Thanks,
Mark

 
clothahump
clothahump's picture

Joined: 2002-11-26
Posts: 127
Posted: Sun, 2004-02-29 12:42

Just your cache needs clearing.

 
rizzay

Joined: 2003-07-25
Posts: 36
Posted: Mon, 2004-03-01 17:01

Is Cache the reason the watermark does not appear as well?

 
cosmic1

Joined: 2003-07-30
Posts: 16
Posted: Wed, 2004-03-03 23:48

Just installed standalone gallery 1.4.2. Gallery works fine. Installed watermark mod Albums load, thumbnails show but get the dreaded red x on main images. Does this mod work with 1.4.2? If I turn off watermarking everything is fine.

 
au

Joined: 2004-02-23
Posts: 2
Posted: Thu, 2004-03-04 18:46

works for me with 1.4.2 using .png watermark image and change, described above.

 
cosmic1

Joined: 2003-07-30
Posts: 16
Posted: Thu, 2004-03-04 19:47

Ok, thx. Problem is I'm using text watermarking (or trying to) but moving those few lines of code didn't solve the problem either :(

 
rizzay

Joined: 2003-07-25
Posts: 36
Posted: Thu, 2004-03-04 21:26

I'm with you cosmic1. I had it working correctly with a previous release, made the text changes after an update and now I have the same situation as you. Anyone got any ideas on how to fix this?

-Mark

 
jflaflamme

Joined: 2003-02-26
Posts: 34
Posted: Wed, 2004-03-10 01:44

Sorry guys, i've BIG PROBLEMS with ( watch this topic for reply ) look like this feature stop workin alone.

RED X -> use mozilla firefox, right click the image and choose VIEW IMAGE, you will see the real error, i can't help anyone with a "red x issue"

As i see, couple of people have problemes since 1.4.2, i'll try it out and give you news

thanks rizzay to reporting me some problems

--------
CACHING
---------

i'm not using it, so it's a little bit hard, BUT, i can recommand you to put your browser to load the page from the network at every visit ( no-cache ) ... try it again

------------
font files > read the README.watermark and try www.google.com
------------

donations are welcome

 
pakus

Joined: 2004-03-12
Posts: 4
Posted: Fri, 2004-03-12 15:33

Hiya,

on http://wapo.upc.es/testNuke/gallery

You can see my albums with watermarking, but it's not working... I've readed this long, long post but i've not been able to solve my problems.

I don't know how to obtain some more log. So... Can anyone help me?

 
IDM_Webmaster

Joined: 2003-12-29
Posts: 45
Posted: Mon, 2004-03-29 20:55
pakus wrote:
Hiya,

on http://wapo.upc.es/testNuke/gallery

You can see my albums with watermarking, but it's not working... I've readed this long, long post but i've not been able to solve my problems.

I don't know how to obtain some more log. So... Can anyone help me?

FYI your link didnt work bro!

 
pakus

Joined: 2004-03-12
Posts: 4
Posted: Mon, 2004-05-03 13:41

Hiya,

Now is working (sorry for the inconvenience).

I didn't understand why my watermark isn't working...

 
justchil
justchil's picture

Joined: 2003-02-07
Posts: 225
Posted: Tue, 2004-05-18 16:45

Hey guys.. read the whole thread now I'm really confused. I keep getting this error...

Fatal error: Call to undefined function: imagecreatefromjpeg() in /usr/home/wvca/public_html/gallery/watermark.php on line 66

I'm working on building php again with gd and the other things mentioned in this post...

any idea's?

 
justchil
justchil's picture

Joined: 2003-02-07
Posts: 225
Posted: Wed, 2004-05-19 04:51

Woot!

After several hours of work trying to get php to recompile it finally works..

:lol:

 
Oggy

Joined: 2004-05-24
Posts: 3
Posted: Mon, 2004-05-24 22:22

Hey Guys,

hopefully someone can help me with this really anoying problem. After doin the changes on both files, I get following two error messages and I can´t rid of them for some reason:

Warning: open_basedir restriction in effect. File is in wrong directory in /home/www/web2/html/fotos/classes/Album.php on line 1223

Fatal error: Failed opening required 'config_watermark.php' (include_path='.:/usr/share/php') in /home/www/web2/html/fotos/classes/Album.php on line 1223

Line 1223 in Album.php says the following:

require_once($GALLERY_BASEDIR . "config_watermark.php");

Anyone knows how to fix this? Would be very nice to know what this error means and how to solve it.

Thanx in advance,

Oggy

PS: config_watermark.php is in the gallery Main directory, Album.php is in the classes directory as you can see. User is the right own, I also tried chmod 777 on the config_watermark.php File. Still the same.

 
dilligaf
dilligaf's picture

Joined: 2003-02-20
Posts: 9
Posted: Wed, 2004-07-14 05:17

Somewhat offtopic but it deals with this script.
I am having problems with people hotlinking my pictures and the extra bandwidth it incurs.
I used to (and still do) use the .htaccess rewrite cond/rule that covers my
albums and works fine if someone directly links an image i.e.

http://www.domain.com/album/albumname/imagename.jpg

but now that I'm using semisphere/jflaflamme's excellent watermarking script, the .htaccess did not help as now the images were called from a different area. I added the .htaccess to my Gallery directory but it still did not help. I then noticed that phgrove's excellent little mod to the script that works fantastic.

phgrove wrote:
// What are the websites (hostnames) that can use this
// image?
// If your site can be accessed with or without the
// "www" prefix, make sure you put both here. Do not put
// any trailing slashes ("/") nor any "http://" prefixes.
// Follow the example below.
$validprefixes = array (
"petergrove.co.uk",
"www.petergrove.co.uk"
) ;

$referrer = getenv( "HTTP_REFERER" ); //Get the refferer URL

function isreferrerokay ( $referrer, $validprefixes )
{
$validreferrer = 0 ;
$authreferrer = current( $validprefixes );
while ($authreferrer) {
if (eregi( "^https?://$authreferrer/", $referrer )) {
$validreferrer = 1 ;
break ;
}
$authreferrer = next( $validprefixes );
}
return $validreferrer ;
}

// What is your email address?
// If you want to be informed when someone tries to use
// this script to access an image illegitimately, you
// must uncomment (remove the "//" prefix) the following
// line and change it to point to your email address.
$email = "peter@petergrove.co.uk" ;

Anyhow here is my problem. With the code piece below, instead of the hotlinker/image stealer getting a 404 not found error I would like them to get the image I use in my .htaccess file for stolen images.

phgrove wrote:
else {
//The refferrer is not an allowed one to use your images, so lets email you there details
if (isset($email)) {
mail( $email, "Bandwidth Theft Alert", "WARNING:nn$referrerntried to accessn$imagen", "From: CHImageGuard <$email>" );
}
header( "HTTP/1.0 404 Not Found" );
}
}

I tried using the echo echo "<img src=\"http://www.doman.com/stolen.jpg\">"; and print print "<img src=\"http://www.doman.com/stolen.jpg\">commands but get nothing showing (broken image). Right clicking on it gives me the complete URL for the image stolen, not for the image I want .

here is the link to my test page so you can see the result for yourself.

http://www.dilligaf.to/temp/home1.html

And this is what it should look like. (hotlink to the actual image being stolen)

http://www.dilligaf.to/temp/home2.html

(you may have to refresh your browser if you have previously looked at the original image)

Anyhow thanks in advance for any help on this

 
Otter

Joined: 2004-07-31
Posts: 3
Posted: Sat, 2004-07-31 00:10

The reason you get a broken image is because echo and print will return HTML code, but as the HTML tag used is <img> the client's browser expects to recieve either an image or information (for example, a 404 error). You could redirect the client to the image you want to be displayed.

header("Location: http://www.example.com/hotlink.jpg");

This would tell the client's browser to load the URL specified.

 
KCPokes

Joined: 2004-10-01
Posts: 3
Posted: Fri, 2004-10-01 15:01

I was able to get the mod working, after fighting GD for a while. It works great, BUT my issue is that, being as it doesn't really modify the picture, it does nothing for you when you link to a picture.

There was a second mod in this thread, using mod_actions, but the link to the actual information and mod is invalid. Was anyone else successful in implementing the mod_actions route? I messed with it, but what I was seeing is that every image, including any banners, etc, were being rewritten. Obviously that is not what I would want. I figure it must be something I am doing incorrectly, so if you have implemented the mod_actions route, I would appreciate some assistance.

Thanks!

 
fabien

Joined: 2004-12-18
Posts: 18
Posted: Mon, 2004-12-20 22:28

jflaflamme,

Watermark_mod-0.4.2 does not seem to apply the albums property 'Use watermarking on this album?' to nested albums when the option box 'Apply values to nested Albums' is checked inside the 'Album Properties' page (at least on gallery version 1.4.4-pl2).

The easiest way to solve this issue is to add the following line inside the classes/Album.php file, under the setNestedProperties() function:

$nestedAlbum->fields["watermark"] = $this->fields["watermark"];

Like this for example:

function setNestedProperties() {
  for ($i=1; $i <= $this->numPhotos(1); $i++) {
    if ($this->getAlbumName($i)) {
      $nestedAlbum = new Album();
      $nestedAlbum->load($this->getAlbumName($i));
      $nestedAlbum->fields["watermark"] = $this->fields["watermark"];
      ...
    }
  }
}

That's it, hope this helps :wink:

Fabien

 
jflaflamme

Joined: 2003-02-26
Posts: 34
Posted: Tue, 2004-12-21 02:53

Hi Fabien,

I stopped working on watermark mod since gallery included a watermark script ( note mine ) in a couple of releases ago.

They didn't contact me, and didn't use it anyway, also, watermarking is included and revamped in gallery2

Tell me Fabien, why you didn't use the one provided with 1.44 ?

I did not tried any recent versions with my mod, but i'm sure it can work easily, this is not a newbie script, you need i good understanding of php, and flat file config.

A lot of people who contacted me ( most of them ) had problems ... but each times, it was a misconfigured path or variables ( or missing GD or fonts .. )

I'm willing to do further help, but again, i don't know why using it, because watermarking is included in gallery latest relases.

If i'm wrong please correct me, nor, to drop a comment.

 
fabien

Joined: 2004-12-18
Posts: 18
Posted: Tue, 2004-12-21 12:43

Jean-Francois,

Thanks for the quick reply.

I have been using your watermark mod before gallery included a watermark script and customized it a bit as follows:

1. Associate thumbnails watermark image to the thumbnailed file type. Since it is possible to use a movie frame as a movie thumbnail image (via ffmpeg for example), your script is used to quickly indentify movie thumbnails in an album. Thumbnails corresponding to a movie (i.e. showing a movie frame) have a special watermark image whereas thumbnails of pictures don't.

2. Allow different watermark sizes according to the image size (this has nothing to do with thumbnails). In case of a resized image, a small watermark is used whereas a bigger watermark image is used for original size images.

I did not have time up to now to check if the watermark script included in gallery already provides such features. If it does not, I will customize it, keeping in mind that your watermark mod is a very good backup solution anyway :wink: .

Cheers,

Fabien

 
jflaflamme

Joined: 2003-02-26
Posts: 34
Posted: Mon, 2004-12-27 15:58

Thanks for the comment Fabien :-)

 
jflaflamme

Joined: 2003-02-26
Posts: 34
Posted: Fri, 2007-06-08 14:36

Hi just typped my name on google for fun .. and i saw nice results .. like this one

Security Advisories ...

http://www.frsirt.com/english/advisories/2007/1674

And on security focus ..
http://www.securityfocus.com/bid/23837/exploit

-------------------------

VotreMedia Watermark Module For Gallery Remote File Include Vulnerability

Attackers can use a browser to exploit this issue.

The following proof-of-concept URI is available:

http://www.example.com/watermark.php?GALLERY_BASEDIR=shell.txt?

----------------------
However .. this is a gallery problem, not a mod problem ..

If i try it on my site
http://votremedia.com/gallery/watermark.php?GALLERY_BASEDIR=shell.txt

i get : Security violation ..

Why ? Because watermark.php require init.php

Quote:
require($GALLERY_BASEDIR . "init.php");

And init.php contain this

Quote:
// Hack prevention.
$sensitiveList = array("gallery", "GALLERY_BASEDIR");
foreach ($sensitiveList as $sensitive) {
if (!empty($HTTP_GET_VARS[$sensitive]) ||
!empty($HTTP_POST_VARS[$sensitive]) ||
!empty($HTTP_COOKIE_VARS[$sensitive]) ||
!empty($HTTP_POST_FILES[$sensitive])) {
print _("Security violation") ."\n";
exit;
}
}
?>

So we got Security violation when we try his pseudo hack ..

Another thing ...
To have $GALLERY_BASEDIR dangerous, you need to have your php INSECURE with registerglobals ON
http://php.net/manual/en/security.registerglobals.php

So i don't think this is a hack. But i found important to let people now.

Also, i stopped developping a while ago, because Gallery 2 have watermarking enabled (not my code)

To finish, if you still use gallery 1 and my mod :

Make sure you have : register_globals = Off in your php.ini ... because a lot of "hacks" will be possible, not only one ..
Make sure your gallery version have the : // Hack prevention. thing ..

No need to modify watermark_mod !