PDA

View Full Version : "addon": Watermark


fantastic.poison
08-03-2005, 03:55 AM
Hi all,

I wasn't sure whether to call this an addon (since it doesn't touch the index/admin code) or a mod (since it can't live in /addons), but I've just added a script & .htaccess file that generate a watermark on the fly for every photo in the /images directory.

http://pixelpost.org/v1/index.php?x=downloads&details=97

Just create a watermark PNG, upload it & wrapper.php to /admin, then edit & upload .htaccess to /images.

I didn't actually write it, and don't like what on-the-fly image generation does to server loads, but it's a nice stopgap until I have time to write a real mod.

Mostly, I'm posting to find out why I couldn't add a screenshot to my entry in the developer's system? It says it's there, but doesn't show up...

Connie
08-03-2005, 06:22 AM
welcome here!

please, keep in mind, when you write an addon, that the rule is

that either
- additional files should sit together with the addon in \addon-folder
- or as subfolder in \addon
- or in \includes
- or in \includes\subfolder

if it's an addon, and only used for an addon, it should stay in \addon
if it's coming with an addon but could be used for many purposes it could sit in \includes (not preferred, go ahead reading..)

but: we suggest, prefer, ask, would like to have this as a rule maybe:
that everything what comes with an AddOn should stay in \addon-folder
so it is easy to install, delete, de-activate maybe
also for future enhancements!
also for support!

please think about that and change it
We try to get a clean directory-structure

about the image, I do not know, I never show up 8)

raminia
08-03-2005, 07:58 AM
wow!
when 1.5 arrives make a clean PP's admin addon from it please.
:)
but it's now basically a mod.

raminia
08-03-2005, 08:02 AM
Mostly, I'm posting to find out why I couldn't add a screenshot to my entry in the developer's system? It says it's there, but doesn't show up...

yeah it stopped working some time before a month ago. I don't know why either.

Thanks again:)

raminia
08-04-2005, 06:06 AM
it needs some DISALLOW in the main .htaccess to avoid search engine bots to sure the image page.
and also disallowing the direcotry listing for the images folder at least.

Connie
08-04-2005, 06:19 AM
@fantastic.poison:

I was thinking about watermarking on the fly when uploading the images to PP already some time ago, but when I experimented with GD-lib I found out that the EXIF-information in the image was gone after adding the watermark

so I'd like to know if your solution keeps the EXIF-info?
If not that should be thought over again, maybe extracting the EXIF-info temporary and adding it back to the image after watermarking

I would be glad to have that as an option, ADMIN/addon, that would be really great!

raminia
08-04-2005, 01:49 PM
@ Connie,
If you check my autoresize addon from Romain autoresize modification you can see that this autoresize function creates new jpg files and reinjects the EXIF info there. That could be a similar solution for other addons/modifications.

(you can fine it in the hacks and modification forum under title "yet another autoresize" ...)

Connie
08-04-2005, 02:09 PM
yepp, but fantastic.poison has written this addon nearly, so he should do it ;=)

fantastic.poison
08-04-2005, 09:26 PM
yepp, but fantastic.poison has written this addon nearly, so s/he should do it ;=)

as mentioned, this is a "stopgap." i didn't actually write it, just adapted it very slightly to PP. since utok's mod already strips out the EXIF data, i didn't consider this, but i will begin development of a real plugin now that includes this functionality. i'm not sure if it's possible to do it as a straight addon, but maybe a standalone script in the includes directory, and an addon to configure it.

raminia, you're right about the disallow. will get on that as well.

jdleung
02-16-2006, 03:17 AM
It's doesn't work on my pc.

and the windows doesn't allow blank file name,which is .htaccess

blinking8s
02-16-2006, 04:23 AM
It's doesn't work on my pc.

and the windows doesn't allow blank file name,which is .htaccess

upload a file called blank.txt onto your server, then through the ftp rename it .htaccess then redownload it, then open it in notepad or wordpad

jdleung
02-16-2006, 09:11 AM
cannot access ftp://localhost/pixelpost/

GeoS
02-16-2006, 09:42 AM
Do you have PP on local or remote machine??
Do you have FTP server on your local machine??

If it is remote machine then its server address is incorrect.

jdleung
02-16-2006, 09:45 AM
I have pp.

GeoS
02-16-2006, 09:47 AM
Pixelpost I have both on remote and local machine so that doesnt give me clear answer.

When I have it local I just edit correct files without downloading it one more time by ftp, ... :P

jdleung
02-16-2006, 03:38 PM
any other better watermark addon?

eon
02-16-2006, 06:59 PM
It is on my list to make one ;)

Vernon.Trent
04-23-2006, 09:45 AM
hi there,

the wrapper.php works with every image and on every webserver.
you can adjust the location of the wrapper.php in the .htaccess file.
my only concern about is, that the image quality decreases after rendering with the watermark. I don't know where to check to improve the image quality after "watermarking".

I tried to ask the developer (http://www.jumpx.com/tutorials/wrapper) but didn't get any answer.

Vernon.Trent
04-23-2006, 07:12 PM
hi
if you are using PP, place the wrapper.php and the watermarked.png in the addons directory. then place your .htaccess file into the images folder of PP.

the .htaccess file should look like this


AddHandler watermarked .jpg
AddHandler watermarked .jpeg

Action watermarked /addons/wrapper.php


anytime an image is called from the image directory, it will be wrapped with the watermarked.png

hope this helps.

greentraveler
05-07-2006, 03:24 AM
Did the wrapper .php download link get changed or pulled? The link in the first post just keeps kicking me to the general add-on/template/mod list.

Vernon.Trent
05-07-2006, 05:33 AM
Did the wrapper .php download link get changed or pulled? The link in the first post just keeps kicking me to the general add-on/template/mod list.

http://www.jumpx.com/tutorials/wrapper/watermark.zip
its exactly the same script like that one from the addon page.

http://www.jumpx.com/tutorials/wrapper
a very good explanation what this script can do.

enjoy ;)
*cheers*

greentraveler
05-07-2006, 07:21 AM
http://www.jumpx.com/tutorials/wrapper/watermark.zip
its exactly the same script like that one from the addon page.

http://www.jumpx.com/tutorials/wrapper
a very good explanation what this script can do.

enjoy ;)
*cheers*

Many thanks...I look forward to working this into my site. :D

greentraveler
05-07-2006, 09:42 AM
Well...I tried it on two different databases and both now default all images to my phpinfo() page. Admin and browse pages, no problem. Just anything from the imgaes folder. And the .htaccess files both disappeared once I renamed them in the images folder.

The instructions were very simple and I honestly don't know where the problem is unless my server is incompatible. You were right Vernon...an excellent set of instructions are on that link.

Luckily, my host has excellent and quick tech support. They can load a daily back-up if I need it, but I'm hoping they'll find a solution that's a litle less drastic.

Vernon.Trent
05-07-2006, 10:03 AM
@greentraveler
your .htaccess did not disappear, it's just not visible to you.
try to set up your ftp-client to show hidden files.

the script works. it's running on my PP :)

greentraveler
05-07-2006, 10:33 AM
Thanks, Vernon. My hosting company untangled it all for me. They said the same thing about not being able to see those files in FTP programs...something I obviously didn't know! Another piece of knowledge earned the hard way. :D

greentraveler
05-07-2006, 10:50 AM
Because I'm obsessed with getting this to work, I just did a fresh install with the same results (although I can now access my .htaccess file).

Vernon, tell me if you see what I'm doing wrong:
"wrapper.php" to /addons with chmod to 775,
"watermarked.png" to /addons (also tried as "watermark.png") with 664.
And .htaccess in /images with "AddHandler watermarked .jpg
AddHandler watermarked .jpeg Action watermarked /addons/wrapper.php"

And it kicks me back to the phpInfo screen instead of a photo. I see how nicely it works on your site and feel like I'm missing something obvious. Any ideas?

I'm running 1.5...are you using an earlier version?

Vernon.Trent
05-07-2006, 12:02 PM
@greentraveler

wrapper.php in /addons (644 should be ok.)
watermark.png in /addons (644 should be ok.)

.htaccess with this content (in /images folder)

AddHandler watermarked .jpg
AddHandler watermarked .jpeg

Action watermarked /addons/wrapper.php


the above shoud work.
I've checked here on my machine. all well. pp 1.5

greentraveler
05-07-2006, 04:47 PM
SOLVED THE PROBLEM THANKS TO VERNON! :D

Vernon.Trent
05-23-2006, 05:10 PM
@karrhun

put the wrapper.php and watermark.png in the admin folder

.htaccess in /images

content of .htaccess
AddHandler watermarked .jpg
AddHandler watermarked .jpeg

Action watermarked /admin/wrapper.php

should work as it works on my PP.

Vernon.Trent
05-23-2006, 10:42 PM
I see that your pp is in an extra folder (photos)
in that case you must adjust the line in .htaccess to

AddHandler watermarked .jpg
AddHandler watermarked .jpeg

Action watermarked /photos/admin/wrapper.php

try this one

bagoo
05-26-2006, 03:17 AM
Hi.

I tried all the possible ways of using this addon but it didn't work!

I'm using:

PHP-version 4.3.10 (Pixelpost's min requirement: PHP version: 4.3.0 )

MySQL version 3.23.47-max-debug (Pixelpost's min requirement: MySQL: 3.23.58 )

GD-lib bundled (2.0.28 compatible) with JPEG support

File Uploads to pixelpost site are possible.

Server Software Apache/1.3.23 (Win32)

EXIF Pixelpost is using exifer v1.5 for EXIF-information.


And PP 1.5


Any help,

Thanks

Joe[y]
05-26-2006, 06:59 AM
would like to point out that your mysql version doesn't meet the minimum requirements for pixelpost bagoo. if you're having trouble with anything involved with pixelpost then that's probably your problem.

bagoo
05-26-2006, 11:41 AM
Thanks for the fast replay. Actually I have the following seeting on my host:

You are running Pixelpost version 1.5 - April 2006
Latest pixelpost version: Check
Looking for help or want to give feedback, please step into pixelpost forum.: www.pixelpost.org/forum/


Host Information

PHP-version 4.4.2 (Pixelpost's min requirement: PHP version: 4.3.0 )

MySQL version 4.0.25-standard-log (Pixelpost's min requirement: MySQL: 3.23.58 )

GD-lib 2.0 or higher with JPEG support

File Uploads to pixelpost site are possible.

Server Software Apache/1.3.33 (Unix)

EXIF Pixelpost is using exifer v1.5 for EXIF-information.


Paths
Guessed imagepath:
Configured Imagepath: ../images/

Image Directory: OK - Can we write to the directory? YES. CHMOD: 0777

Thumbnails Directory: OK - Can we write to the directory? YES. CHMOD: 0777

Language Directory: OK

Addons Directory: OK

Includes Directory: OK

Templates Directory: OK


And still can't make it to work. A bit frustrating. your help please. Thx.

bagoo
05-26-2006, 06:06 PM
Hi.

I upgraded my MYSQL and PHP to the latest version on my loccal server and the watermark worked just fine. however, it still doesn't work on my online host (info in previous post).

Any suggestions.

Thx.

Joe[y]
05-26-2006, 09:51 PM
Hi.

I upgraded my MYSQL and PHP to the latest version on my loccal server and the watermark worked just fine. however, it still doesn't work on my online host (info in previous post).

Any suggestions.

Thx.

update your online host as well to the same version as your local server?

jimtron
05-19-2007, 03:56 AM
I'm having a problem with this. The addon is working, but the PNG is distorted; here's a screenshot:
http://www.newberryphotography.com/imglink/Picture%2047.jpg

I get those vertical stripes on every page when the addon is installed. Here's a direct link to the PNG, which looks fine in Firefox:

http://www.newberryphotography.com/imglink/watermark.png

If anyone has any suggestions, I'd appreciate hearing them.

Dkozikowski
05-19-2007, 07:47 AM
What browser are you using when you see the distorted image?

Maybe try gif instead of a png?

jimtron
05-19-2007, 05:14 PM
What browser are you using when you see the distorted image?

Maybe try gif instead of a png?

Firefox 2 on OS X. I'll try it with a gif.

greentraveler
12-05-2007, 11:22 AM
Can anyone guess why resizing my thumbnails would make the .htaccess file's presence in my images folder stop displaying the actual photos? I'm at a total loss, but rely heavily on this add-on.

dakwegmo
12-05-2007, 01:33 PM
Can anyone guess why resizing my thumbnails would make the .htaccess file's presence in my images folder stop displaying the actual photos? I'm at a total loss, but rely heavily on this add-on.

The only thing that I can think of is that maybe your watermark image was written over, or maybe some permissions were changed. Is that image still where its supposed to be and intact?

greentraveler
12-05-2007, 04:30 PM
The only thing that I can think of is that maybe your watermark image was written over, or maybe some permissions were changed. Is that image still where its supposed to be and intact?

The watermark is still where it's supposed to be and I've even tried deleting it (along with the actual watermark add-on file and .htaccess) and re-uploading with no success.

Do the actual images themselves need to be set to a particular permission? I wondered if regenerating the thumbs could have set them to something different that makes them inaccessible to the add-on.

Vernon.Trent
12-05-2007, 04:56 PM
refreshing the thumbs should not change something because the wrapper don't care about the thumbs.
check your file locations

.htaccess in your images folder (644)

content of the htaccess file

AddHandler watermarked .jpg
AddHandler watermarked .jpeg

Action watermarked /your pp location/admin/wrapper.php

location of your wrapper.php as shown above /admin/wrapper.php (644)
same location for the watermark.png like wrapper.php

your images folder should have 777 permission

that's all. that's how it works with my PP since 4 version updates


hope this helps

cheers
v.t.

greentraveler
12-05-2007, 05:02 PM
Thanks for your help (again) Vernon. Unfortunately, I've already tried everything and still no luck. Since this makes absolutely no sense, I guess I'll just resort to manually adding watermarks retroactively and in the future.

greentraveler
12-05-2007, 06:13 PM
FIXED IT!

My hosting company's (icdSoft) awesome support quickly diagnosed it as a problem because I'm still using PHP4 instead of 5, added a line into my main .htaccess file and it's working again.

Thanks for the replies, guys. Cheers!

Vernon.Trent
12-07-2007, 05:47 AM
cool! :)

Vernon.Trent
02-10-2008, 11:51 AM
FIXED IT!

My hosting company's (icdSoft) awesome support quickly diagnosed it as a problem because I'm still using PHP4 instead of 5, added a line into my main .htaccess file and it's working again.

Thanks for the replies, guys. Cheers!
guess it looked dlike that?

AddType x-mapp-php5 .php
AddHandler x-mapp-php5 .php

owen-b
02-20-2008, 04:22 PM
Hi folks - I've got this on my server with the php and the png in admin, the htacess in images, all set to the right chmod numbers, and when I load my page it won't load the actual image, not the watermark. Any ideas why?

dakwegmo
02-20-2008, 05:50 PM
Are the wrapper.php and watermark.png files in your /admin directory currently?
Did you modify the .htaccess file?

owen-b
02-21-2008, 10:50 PM
Wrapper and Watermark are in admin, and .htaccess has been altered to reflect that.

Should I have left in the stuff in the htacess file about gifs and pngs? I basically only left the jpg-related lines in there and deleted the others, as they weren't ever mentioned by Vernon Trent.

What happens in Safari at least is that the spinner that depicts loading appears, then instead of the image jpg fading in, a 'question mark' icon (which means unavailable image or something in Safari) appears, and the name of the image is rendered in text at the top of the blank space. The template can still detect the image size though, interestingly, even though it can't display it.

dakwegmo
02-21-2008, 11:37 PM
Is this for myglasseye.net? When I go to http://www.myglasseye.net/admin/watermark.png or http://www.myglasseye.net/admin/wrapper.php I'm getting a 404 error message. If the files were there and had the appropriate permissions then I should be able to see them, or at least get different error message.

Also, the .htaccess file in your images folder should include at least this information:

AddHandler watermarked .jpg
AddHandler watermarked .jpeg

Action watermarked /pixelpost/admin/wrapper.php

owen-b
02-22-2008, 09:29 AM
Yep, that's correct, they aren't there at the moment because they render my photoblog somewhat useless to visitors! ;)

My htaccess didn't have /pixelpost/admin/wrapper.php, just /admin/wrapper.php (like Vernon suggested) because Pixelpost is in the root (public_html) folder of my server. Is that not correct?

owen-b
02-22-2008, 09:41 AM
Is it perhaps something to do with my template not being a standard 'display image' template? It fades them up and has clear gifs on top for the navigational arrows etc.

dakwegmo
02-22-2008, 12:29 PM
/admin/wrapper.php is the correct path for pixelpost installed in the root of the site.

This addon isn't template dependent. When it's working, if you access any jpg in the images directory, it layers your watermark over the requested jpg and presents them as a single image. So if you were to browse to myglasseye.com/images/someimage.jpg you should still see the watermark over the image.

Based on what you've said so far you've done everything right. Do you by any chance have anything else in your image/.htaccess file, or perhaps an .htaccess file in your root directory that might be overriding the settings for this addon?

owen-b
02-22-2008, 12:37 PM
Yeah I do have an htaccess file in the root:

# -FrontPage-

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName www.myglasseye.net
AuthUserFile /home/XXXXXX/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/XXXXXX/public_html/_vti_pvt/service.grp


In the images folder is all the photos themselves, and the htaccess file for the watermark (when I have it in there, which is never until I can get this to work coz it stops my photoblog from displaying the photos!) and all it contains is this:

AddHandler watermarked .jpg
AddHandler watermarked .jpeg

Action watermarked /admin/wrapper.php

Should that read 'watermark' instead of 'watermarked'?

The wrapper.php file is completely untouched at the moment. Is that possibly my mistake? Does it need custom edits made to it?

owen-b
02-22-2008, 12:47 PM
Seems like it's a problem with the htaccess - removing it from the images folder makes everything work again, even if watermark.png and wrapper.php are still in the admin folder...

Also, adding back in the gif and png lines to the htaccess file and putting it back in images makes no difference.

Hmm. Any ideas? I don't even know what htaccess files do, so I'm at a loss now!

Just to be totally clear, here's what I've done so far.

1) Created a watermark.png file in Photoshop and placed it in public_html/admin
2) Put the wrapper.php file, unedited in any way, in public_html/admin
3) Changed the .htaccess file and placed it in public_html/images

The .htaccess file contains the following and nothing else, not even blank lines:

AddHandler watermarked .jpg
AddHandler watermarked .jpeg
AddHandler watermarked .gif
AddHandler watermarked .png

Action watermarked /admin/wrapper.php

owen-b
02-23-2008, 05:05 PM
Anyone got any thoughts? :(

Vernon Trent to the thread! Paging Vernon Trent!

Vernon.Trent
03-05-2008, 02:23 PM
any updates on that, Owen?

owen-b
03-07-2008, 11:38 AM
Well my hosting people really worked hard on this. They researched the script, tried it on different servers, all sorts, and they couldn't suggest or tweak anything that wuld make it work.

In the end they found an alternative script that does a very similar thing, but they cant make that work on the main page of my blog either. However, if you surf to the direct location of the image it does indeed display the watermark, but really badly. It's a PNG with transparency and the transparent elements show up as semi-transparent yellow. Yuk.

Basically, it doesn't work.