![]() |
PHP - How to get dimension of hotlink protected image? (TGP)
Hey all :)
I'm trying to retrieve the dimensions/resolution of the fullsize images of TGP galleries. getimagesize() is of course not working with hotlink protected images, so I guess the only way is establishing a connetion with fsockopen() and sending false referrer information. I tried that already and retrieving http status, last modified date, filesize etc is no problem ... but how would I go about the resolution? I tried sending a "GET /image.jpg" already, but then my browser prompts me to download the file and choses myscript.php as the filename. My head hurts already :-/ Maybe there's a rather simple solution? Writing the output of the GET request to a temp file on my webspace and doing a getimagesize() was what I thought about ... but it seems a little overcomplicated? Also ... retrieving all pictures of the ~700-800 tgp gallery submission every day would be quite a waste of bandwidth :-/ and even worse ... when I run my linkbot to check all submitted galleries, this would be ... HOLY MOSES ... too many gigs to count :o Thanks for aaaaaaaaalllll help |headbang| |
Actually PHP can bypass hotlinking(If I remember right, from some TGP scripts)
PHP Code:
Also look at this code snippet from my thumbnailer routine: PHP Code:
|
Thanks for your answer :) Unfortunately it's not working for me, b/c as far as I know getimagesize() cannot bypass hotlinking |cry|
I tried it with this image: http://www.shizzn.com/x/stuff/open/cimg3621.jpg - no hotlink protection http://www.shizzn.com/x/stuff/prot/cimg3621.jpg - htaccess hotlink protection I know tried it like that: Code:
$target_host = "www.shizzn.com"; I just really s*ck! when it comes to file operations *lol If only a head request would also give info about the dimensions :( I'm using the head request to check the status (redirection, 404 etc) and the image size in bytes, which works perfectly fine :) |
Forgive me for sounding naive, but isn't this one of the many reasons that anti-hotlinking protection is in place?
|
@greenie, No worries :)
I haven't used payed scripts for years, but as far as I remember they have anti-cheat mechanisms as well which are supposed to detect redirects, image size, dimensions and stuff. Brownie for example was one of the first - if not the first - scripts to retrieve image sizes and stuff. So basically I'm just trying to find out how to do, what every good script should be able to do :) It just has! to be possible to retrieve the dimensions of images, without downloading it entirely. After all, I want to make it a blazing fast script :D And right now it's sloooooooow ... but good! *lol If only all submitters would just stick to the rules of TGPs/MGPs! *lol damn cheaters. |
All times are GMT -4. The time now is 03:45 PM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc