long string of characters from imported JPG in XML Editor

General discussions about Inkscape.
User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

long string of characters from imported JPG in XML Editor

Postby brynn » Mon Oct 10, 2011 6:00 pm

Hi Friends,
I was just looking in the XML Editor of an image into which a JPG was imported. (Originally I was looking to try and answer another topic, but as often happens, I have more questions than answers, lol.) And of course many of you know that I don't understand much about XML. I have read that chapter in the Guide, but it doesn't tell you what all the attributes are or what they mean. I've learned a bit by trial and error, but not enough to answer my questions about this.

With the JPG selected, I opened the editor, and under the attribute "xlink:href" the value is "data:image/jpg;base64,....". The "....." represents an incredibly long string of characters. I pasted into OOWriter, to learn that there are well over 100,000 characters! (103,544) OMG! So I have several questions.

First and foremost, why so many characters? Is this why some SVG images which contain imorted raster images can have inflated file sizes, compared to the same image without the import?

Does Inkscape assign these characters?
Or do they come somehow from the image itself?

I know in.html"postlink-local" href="viewtopic7a68.html?f=5&t=10408">viewtopic.php?f=5&t=10408)

I guess there must be some reason for all those characters, and I just want to understand what it is. Because with all the problems many people have working on very large images, it seems the less data like that attached to the image, the better and faster Inkscape might work?? To me it seems directly related to the file size. But maybe not? If not, why?

Thanks for your help! I always appreciate it :D

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: long string of characters from imported JPG in XML Edito

Postby ~suv » Mon Oct 10, 2011 7:23 pm

brynn wrote:Or do they come somehow from the image itself?
They are the image - the embedded image (in a format that can be included in the SVG file (it is encoded because an SVG file is a plain text file and you cannot just insert the binary data of the image as is)).

brynn wrote: guess there must be some reason for all those characters, and I just want to understand what it is.
It is the embedded bitmap image - as opposed to the linked image.

See also

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: long string of characters from imported JPG in XML Edito

Postby brynn » Mon Oct 10, 2011 9:54 pm

Ah-HA!!
So I was looking at an imported image that has been embedded rather than linked! Well I was off to a bad start there, lol! (as far as trying to help in the other topic, which is about a linked image)

So when you say that all the "text" IS the image.....hhhmmmm, there is much to learn here. The characters are the encoding?

I understand that XML is like a code....or maybe it IS a code, that describes the image. So now I'm curious how the raster image is converted to the huge character string. Is there any documentation you can refer me to, so I can read about how it happens? Like is it some random text that Inkscape creates to represent the image, or are the characters a code that describe the raster image? Could someone theoretically look at the characters and know something about what the image looks like?

I think I have read one or both of those links, but I will review. And I will experiment with linked image as well. But I'm really curious how the image gets converted to the huge character string. Or how the huge character string describes the image, if that's the case? I think I might be asking how encoding happens.....??


Return to “General Discussions”