Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
orphean
Apprentice


Joined: 21 Oct 2008
Posts: 147
Location: Olympia, WA

PostPosted: Mon Aug 30, 2010 12:15 am   

<IMAGE> and <IMG> Limitations
 
I was playing around with 3.23a on Imperian (IRE Mud) today. I noticed that Imp is sending back URLs to images of maps within their Room GMCP package. Ie, %gmcp.room.info.map might contain www.imperian.com/irex/maps/clientmap.php?map=100&building=0&level=0 23 26. I've been %concat'ing http:// in front of this thing to add the protocol.

I'd like (using <IMAGE> or <IMG> dont' really care) to pull this picture into my session. CMud is apparently paying attention to filetype extensions and so while it will download the image it won't actually display it. I created a quick cgi script that just downloads the image data from IRE (happens to be in png format) from a preset url. I named this cgi script 'ire.png' and when I point Cmud at it the image is displayed just fine.

Is there anyway to either work around this problem, or maybe submit a feature request to allow IMG and IMAGE to function in this kind of situation?
Reply with quote
dbosst
Apprentice


Joined: 15 Jun 2010
Posts: 121

PostPosted: Mon Aug 30, 2010 1:48 am   
 
As far as I know Cmud doesn't have any utility to pull images and I looked for quite a bit but perhaps someone else will know...

On another note I wrote a simple visual basic app a while ago using COM that would do this just for the fun of it.. its pretty simple since it doesn't do anything like resize the image or crop the window to a certain part of the map like you would see in the java client.. but since it doesn't show hidden exits or stuff like that I decided to forget about it and go back to my own map in cmud

Also you should realize that the MAP image does not show your current location overlayed on the map, it just gives you coordinates on the grid of where you should be, you have to do overlay a blue circle on your room to show you where you are...
Reply with quote
orphean
Apprentice


Joined: 21 Oct 2008
Posts: 147
Location: Olympia, WA

PostPosted: Mon Aug 30, 2010 1:54 am   
 
Well it does work. The MXP <IMAGE> tag has a URL parameter you can use and CMud will happily go out and download the image before displaying.

ie,
Code:
<image URL="http://myserver.com/images/" totallyradimage.jpg>

and
Code:
<img src="http://myserver.com/images/totallyradimage.jpg">


Will both happily download and display totallyradimage.jpg.

The problem I'm encountering is that unless that file's filetype is the same as a supported image format it won't try to display the image even though it's capable.

So the above examples work fine but something like:
Code:
<img src="http://myserver.com/cgi-bin/getimage.cgi?name=totallyradimage">

isn't working even though the cgi script is returning valid image data.
Reply with quote
dbosst
Apprentice


Joined: 15 Jun 2010
Posts: 121

PostPosted: Mon Aug 30, 2010 6:00 am   
 
edit:

after some checking looks like it actually does not like the question mark character.... so it doesn't even send the request....has nothing to do with the file extension

unfortunately ? is a reserved character so you can't do url encoding like change it to %3F /// it just won't work...
Reply with quote
orphean
Apprentice


Joined: 21 Oct 2008
Posts: 147
Location: Olympia, WA

PostPosted: Mon Aug 30, 2010 2:02 pm   
 
Interesting! I misinterpreted what was happening. I saw the download window open and close and thought the download was completing. Well maybe this can be looked at, it'd be a nice capability.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23377
Location: Colorado, USA

PostPosted: Mon Aug 30, 2010 4:11 pm   
 
I'll take a look at this to see what I can do.

Can somebody post a real test URL for an image file that really exists to make it quicker for me to test this?
Reply with quote
orphean
Apprentice


Joined: 21 Oct 2008
Posts: 147
Location: Olympia, WA

PostPosted: Mon Aug 30, 2010 7:50 pm   
 
Sure Zugg:

http://www.imperian.com/irex/maps/clientmap.php?map=100&building=0&level=0 23 26

That's a real url returned from Imperian via GMCP. Thank you for looking at this!
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 3545
Location: Pensacola, FL, USA

PostPosted: Mon Aug 30, 2010 8:19 pm   
 
That image wont even load in my browser, said it had errors... odd.
_________________
Windows 10 Home Premium 64-bit
AMD Phenom II x6 1055T 2.8GHz 16GB
CMUD Pro v3.34
Reply with quote
dbosst
Apprentice


Joined: 15 Jun 2010
Posts: 121

PostPosted: Mon Aug 30, 2010 8:31 pm   
 
It depends on your browser but in that case, the spaces really should be replaced with %20

try
http://www.imperian.com/irex/maps/clientmap.php?map=100&building=0&level=0%2023%2026
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23377
Location: Colorado, USA

PostPosted: Mon Aug 30, 2010 10:08 pm   
 
Well see, the problem with this is that CMUD needs to be able to download the image and store it in a file on your disk. And in the above case, what should the disk file be called? There isn't any file name there (except for maybe clientmap.php). MXP was only designed to download actual image file names and not "dynamic" image data created by a URL like this.

So I'm not sure what CMUD is supposed to magically do with this, sorry.
Reply with quote
dbosst
Apprentice


Joined: 15 Jun 2010
Posts: 121

PostPosted: Mon Aug 30, 2010 10:18 pm   
 
ah so it downloads it to disk to cache it? how about just replacing "?" with "_" and any other invalid chars with "_", that will still work right? you'll still get a unique file name from it
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23377
Location: Colorado, USA

PostPosted: Mon Aug 30, 2010 10:59 pm   
 
That helps, but Windows still doesn't know the image file type. It needs a valid file extension to load the image properly.

What I've done in the next version to try and help with this is to add a "type" argument to the IMG and IMAGE MXP tags. So you can do:
Code:
#mxp <img src="http://www.imperian.com/irex/maps/clientmap.php?map=100&building=0&level=0%2023%2026" type="png">

and then it will work. A bit of a kludge, but I don't see any other way.
Reply with quote
orphean
Apprentice


Joined: 21 Oct 2008
Posts: 147
Location: Olympia, WA

PostPosted: Mon Aug 30, 2010 11:08 pm   
 
That looks like it'll work fine. Thanks a bunch for taking the time to get this in there. It was hardly high priority, just seemed a shame not to use what IRE was providing.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23377
Location: Colorado, USA

PostPosted: Mon Aug 30, 2010 11:57 pm   
 
Having looked at the maps from that URL, it's not really something you will want to draw in the main session window...it's a very large file. But yeah, it was worth cleaning it up.
Reply with quote
Fizban1216
Apprentice


Joined: 03 Feb 2007
Posts: 170

PostPosted: Tue Aug 31, 2010 12:30 am   
 
shalimar wrote:
That image wont even load in my browser, said it had errors... odd.


I'm curious, what browser are you using?

I tried it in Opera 10.71, Firefox 3.68, Safari 5.0.1, Chrome 6.0.472.51, IE 8, and the latest IE9 Platform Preview and it worked in all of them.
Reply with quote
orphean
Apprentice


Joined: 21 Oct 2008
Posts: 147
Location: Olympia, WA

PostPosted: Tue Aug 31, 2010 2:00 am   
 
Zugg wrote:
Having looked at the maps from that URL, it's not really something you will want to draw in the main session window...it's a very large file. But yeah, it was worth cleaning it up.


Yeah some are much smaller, that was a huge one. I sort of want them in their own tab I think. Anyway thanks again, this sort of support is why re-licensing was such a no brainer for me.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23377
Location: Colorado, USA

PostPosted: Tue Aug 31, 2010 3:46 am   
 
Tell your friends Very Happy
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Tue Aug 31, 2010 1:09 pm   
 
Ahem, with this latest change, it seems a script I have no longer works...

#MXP <image ./Images/clear.gif> used to show the 'clear' gif for displaying my local weather. Now all it does is attempt to download it each time and never displays it. Adding type doesn't fix it, either...

Charneus
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23377
Location: Colorado, USA

PostPosted: Tue Aug 31, 2010 4:44 pm   
 
Yep, it's because of the . at the beginning of the name. I didn't support relative filenames in the latest change. Added to bug list.

See, that's what I get for trying to fix something at the last minute Crying or Very sad
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net