0

I am trying to alter some images which are located in my attachments dir and pulled out by an attachment script. something like: /attachment.php?attachmentid=543&d=1319371426&stc=1&fromvw=1

somehow the ImageCreateFromPNG doesnt want to recognize these links as a valid PNG

but when inspecting the image it IS valid.. for example: http://www.birthright.net/forums/attachment.php?attachmentid=543&d=1319371426&stc=1&fromvw=1

is there a way to "force" it as PNG? or any other solution for this?

1 Answer 1

3

That URL requires you to login first, that would require the server to authenticate with the vBulletin forums that Brightright uses and then you could receive the image. You could always do a CURL post to simulate a login using all the variables that the login form uses on that page. Then after you are logged in, you could get the image.

You are currently receiving HTML content of the login page, hence the "invalid" PNG!

Sign up to request clarification or add additional context in comments.

4 Comments

ah didnt think of that.. anyway, i am testing this on a local machine the link was pure for references, and am logged in.. so it does retrieve the PNG.. i can inlude it in IMG tags etc.. except in the imgcreatefrompng function
i just looked at the headers from the file through the url: attachment.php (PNG-afbeelding, 149x177 pixels): image/png, ISO-8859-1, 13,99 KB (14.329 bytes) So it beats me..
Are you already logged in? If so, it's normal. If you are logged in on your computer, and your server is on your computer, it's normal that it won't see the same page, your server doesn't share cookies with your browser (Not even sure if the server can have cookies, don't think so). The attachment.php returns a proper PNG file if you are logged in, if not, it will display HTML.
thanks, i am indeed using the credentials of the local server in the script and not the ones from the server.. i opened the attachments for everyone (not idealistic) .. and the local script is getting the server PNG as result. cheers

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.