PDA

View Full Version : ImageCreateFromPNG through attachment.php issue


Lord Doys
12-01-2011, 03:17 PM
I am trying to alter some images which are located in my attachments dir and pulled out by the 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?

kh99
12-01-2011, 11:26 PM
You can only use a url for that function if fopen_wrappers has been enabled (as the "Tip" on this page (http://us2.php.net/manual/en/function.imagecreatefrompng.php) mentions). Could that be the problem?

Lord Doys
12-01-2011, 11:36 PM
I actually figured it out.

With the mod i pull attachment images onto a google map which seem to work fine.
But for testing purposes i created a file that was outside the vbulletin framework.

so when you call ImageCreateFromPNG with the attachment url.. that page is not logged in, even if you might be logged in..

so the ImageCreateFromPNG was getting a html page (login screen) instead of a png.

there are two solutions: open attachments vor guests
or make sure it is in the framework.

thanks for the reply though