Bug 500 : loadImage fails on URLs not ending in a proper filetype extension
Last modified: 2007-01-29 16:07




Status:
RESOLVED
Resolution:
FIXED -
Priority:
P2
Severity:
normal

 

Reporter:
fjen
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2007-01-26 07:47
loading:
loadImage( "http://tiny.media.mit.edu/images/icons/144036.png?1169771223" );

will fail, but this works:
loadImage( "http://tiny.media.mit.edu/images/icons/144036.png" );

i see the problem with not knowing what image-type it is for generic URLs like
renderimage.php?123123 .. but in the case above if the ?XXXX would be stripped off, it should
be able to load.

F
Additional Comment #1 From fry 2007-01-26 07:50
yep, also covered here:
http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Syntax;action=display;num=1165174666

thought i had a bug filed for this but i guess not. i just need to add a
version of loadImage() that includes the file extension separately.
Additional Comment #2 From fjen 2007-01-26 08:06
right, that solves the problem with generic URIs. super!
Additional Comment #3 From fry 2007-01-26 08:33
now checked into svn, please test it if you have time..

fixes both the .png?234234234 problem (even without the version that uses
an extension), and adds a second version of loadImage() that takes the file
type.
Additional Comment #4 From fjen 2007-01-26 09:55
jep. works fine in svn-rev: 3008

PImage msg;
msg = loadImage( "http://tiny.media.mit.edu/images/icons/144287.png?1169831028" );
image( msg, 0,0, width, height );
msg = loadImage( "http://tiny.media.mit.edu/render_icon/144290/5", "png" );
image( msg, 0,0, width, height );

well done, thanks!
F
Additional Comment #5 From fry 2007-01-29 16:07
unfortunately, the new solution won't handle the following scenario:
http://tiny.media.mit.edu/images/icons/144287.png?rand=11634.234234
however i think that's a minor issue, and people can specify the extension
if they're using URLs that odd.