|
|
Hi there, For some reason I can include images in a script description if I include an URL but not if I try to use the "data" images (not sure what to really call it). Eg.:
FAILS: img tag with
Why would this happen? Can this be fixed? |
|
|
Probably so that people don't abuse server space, it's a highly inefficient method of storing images and consumes about 30% more space than just uploading the image would. That data URI is more than 2X larger than the binocular image itself. Could be another reason as well, like, it doesn't work in all browsers. |
|
|
Hi there, Descriptor, yeah I agree that it is inefficient to use this format, though it is great for GM scripts since the image is there and there is no accessing any server (specially in the case of a third party). As for working in all browsers, I'm not sure if it does, but it does in mine when I made a simple HTML at my PC or even in my script which is working fine, but not in this site so that wouldn't be the problem in this case. In other words, in this case it really seems to be a site specific issue. (btw, I assume you copied the string to somewhere to see that it was a binocular img, cause I can't see it.... please tell me if I'm wrong). On the other hand, in this case I wouldn't ming putting the image really there but... can I upload the image to be here in the site? I mean I really didn't want to upload it to a third party server, though maybe that's what I should do.... By the way, I also tried another thing that didn't work: using a style tag... it appears as it was text.
Can someone help me with these little problems? (maybe it is simply lack of HTML / site config / ... knowledge) |
|
|
I don't know if it helps, I'm not really following what's going on, but I copied the data image into my address bar and the 17x15 binocular image worked fine for me. |
|
|
Well, I think the issue isn't whether the data URI works, I think we know it works. I added it to a GM test script as an image src and appended the node to a page, then I saved the image which is how I know it's a gif file of 257 bytes. The problem is adding it to a script description (or message post) on this site, which can't be done - I think someone has requested this before.
This server (from my experience with posting here) only allows a limited set of HTML tags, the other tags are escaped or removed. I assume it doesn't allow data URIs at all, converts them to plain text I imagine. Notice also we can't upload any images, even the avatars are created and stored somewhere else. I don't know the reason for this, security or maybe server load. I had this same problem on another forum, I wanted a tiny little icon that wasn't in their icon list, and they had no way to upload one. If I had thought to try a data URI I would have, but I wouldn't expect it to work. It's better to just store it elsewhere anyway, there are lots of free image hosts. The easiest and most reliable way would be to use your own ISP. If you get email from your ISP then they probably give you a little "user web space" like 10MB. That's what I used to do, but I know most people these days aren't even aware they have this option - people can't figure out FTP and noone uses Netscape Composer anymore, so this nifty little feature is fading away (the sad fact is that ISPs just don't bother to explain this anymore). This isn't a real good option if you want to remain anonymous. I like to use imagevenue when I don't want a link going to my own server. They only allow jpg files though, so for an icon I had to either find it in jpg format or convert it to jpg. If the file is very small, thumbnail size, you can link to it directly, so this works out pretty good. There are plenty of image hosts, I don't know the best one but at least imagevenue has very few ads. |
|
|
@Descriptor: Apparently I should just keep my nose out, ignore that post then. Incidentally, I've always found photobucket to work well for image hosting; I use it for all the images in my script metadata. |
|
|
Ok, thanks to both. I guess I'll either simply indicate what it is or I'll have to put it in some other site as you said. The thing is that I wanted to have everything related to my script... in my script.
As for the style, I wasn't sure how it should be (though I kind'a guessed it), but since I had tried to put in the body and it had worked... Anyway... thanks to both for the answers :)
|
|
|
There's no problem putting data URIs in your script, there is probably a limit on the size of the script you can upload anyway.
|
|
|
@znerp : your post is helpful to me - I actually never would have thought to try that. |
