hotlinking to watermarks excluding gifs

vangel

Joined: 2009-12-13
Posts: 20
Posted: Sun, 2009-12-13 05:14

Hi,
I am a long time user of G1 and more of G2. I am also the only guy to have completely integrated CakePHP with G2 using the fabulous API.

Now to my question :D

Animated gifs cannot be watermarked without loosing the animation and quality. I want to enable watermarking of hotlinked images but exclude gif hotlinks to be watermarked. I use URL rewrite ofcourse and I see there may be a way in either htaccess or in rewrite module to do it.
I am using G2 version 2.3xxx

please suggest some solution. thanks for replies. I will get back to your reply as soon as I can.

Vangel

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sun, 2009-12-13 05:27

No way I can think of. Because of G2's "image firewall" I don't think you can use the generic "prevent image hotlinking" rewrite rules and I know you can't use G2's watermark hotlinked items because the way it works is it'll watermark all downloaded images that are not listed in the approved referrers list. It's the same way the prevent hotlinking rewrite rules work.

I don't know if there's any easy change you can make in the code, but I don't think so.

I'm pretty sure this would be relatively easy in G3 since image files are linked to directly and the server (not the application) knows the content-type and you can hotlinking anything you want like so:
http://www.javascriptkit.com/howto/htaccess10.shtml

You can test that and see if it'll work with G2, but I don't think it will.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
vangel

Joined: 2009-12-13
Posts: 20
Posted: Sun, 2009-12-13 05:36

@nivekiam,
thanks for your response. I have not looked at G3 yet. Infact did not know it existed until now. :)

I was looking at the htaccess. I believe there may be a way to exclude GIF watermarking in htaccess. But I am far from an expert in htaccess.

 
vangel

Joined: 2009-12-13
Posts: 20
Posted: Mon, 2009-12-14 20:38

ok this is now officially a really big issue. I cant understand why no one ever bothered to report this. I cant do sitewide watermark or hotlink watermark as it will always break all Gif animations. There is also no way to exclude gif mimetype from being watermarked universally, which would be the easiest work around for the time being.

It is already stated that Gifs cannot be watermark without damaging the original image. Its been a long time since I looked at the code. I never tried the modules codes at all. Does anyone know which code i am looking at or complete manual fix will be deeply appreciated.

I am not trying to bitch too much since this is a great piece of software which is free. what else can i ask for. however it just seems like a huge limitation. My gallery has over half a million images and hundreds of users. Maybe not too many users out there so they never encountered this issue.

thanks.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2009-12-14 20:52
Quote:
I believe there may be a way to exclude GIF watermarking in htaccess. But I am far from an expert in htaccess.

I left it there because you think there is a way. I had posted my response and you weren't asking any more questions. I also have a life and was busy all weekend. We do this support, unpaid, on a volunteer basis in our "spare" time. Just like the very few number of people who are writing the code.

Are you using URL Rewrite to make URLs friendly? If so you might be able to use the method I posted above.

Quote:
http://www.javascriptkit.com/howto/htaccess10.shtml

You can test that and see if it'll work with G2, but I don't think it will.

Try it
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
vangel

Joined: 2009-12-13
Posts: 20
Posted: Fri, 2009-12-25 20:48
nivekiam wrote:
Quote:
I believe there may be a way to exclude GIF watermarking in htaccess. But I am far from an expert in htaccess.

I left it there because you think there is a way. I had posted my response and you weren't asking any more questions. I also have a life and was busy all weekend. We do this support, unpaid, on a volunteer basis in our "spare" time. Just like the very few number of people who are writing the code.

Are you using URL Rewrite to make URLs friendly? If so you might be able to use the method I posted above.

Quote:
http://www.javascriptkit.com/howto/htaccess10.shtml

You can test that and see if it'll work with G2, but I don't think it will.

Try it
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

Again, i say , your efforts are deeply appreciated. I have tried a few methods including your suggestions (yes i did read your response). I havent found a workaround externally. I will have to dig into the code and see if I can get watermark module to ignore GIFs all together. I was looking at the code when I saw your reply. Was hoping to post something more useful.

let me see how I can fix this.

once again. appreciate your help.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2009-12-28 20:05

If you find something, please post it.

I cannot think of a way to do this external to Gallery. If you enable hotlink protection, you'll need to modify the Gallery code for serving images or possibly just in the watermarking module to check if a file type is GIF and not apply the watermark.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here