Are there some size limits in SVG files?

Find quick help here to get you started with Hollywood
Post Reply
Bugala
Posts: 1181
Joined: Sun Feb 14, 2010 7:11 pm

Are there some size limits in SVG files?

Post by Bugala »

I noticed something that looks like some sort of limit in Hollywood, unless I am just running out of memory.

I use https://www.photopea.com/ to save SVG-file, and I noticed that when I try to save it as big enough file, it will result in Hollywood (when trying to open it) saying "Cannot read file filename.svg !"

It seems that saving as 28800x16200 was still readable, but saving as 38400x21600 gave this error.

So is there some limit on SVG files in Hollywood, or am I possibly runnin out of memory or something?

There seems to some other odd behavior when saving SVG image in large pixel size when using photopea, for this before mentioned 28800x16200 file opens fine as long as I dont use "Save as" for the hollywood source file. If I save as it using different name, then even I dont change a single line of code, it starts throwing me this before mentioned error of not being able to open it.

And yes, I am saving the source file to exact same folder as the original one, so it shouldn't be a path problem, but something weird seems to happen when using "Save as" with a different name to save the source file in different name.
plouf
Posts: 473
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: Are there some size limits in SVG files?

Post by plouf »

n]maybe have to do with the fact of the "very old source code in plugin" as discussed here

viewtopic.php?p=18671&hilit=svg#p18671
Christos
User avatar
airsoftsoftwair
Posts: 5450
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Are there some size limits in SVG files?

Post by airsoftsoftwair »

Bugala wrote: Thu Nov 16, 2023 2:22 pm It seems that saving as 28800x16200 was still readable, but saving as 38400x21600 gave this error.
Well, let's do a little calculation. Trying to load or save an image of 38400x21600 in RGB space is going to require 38400*21600*4 bytes for storage. That is roughly 3.5 gigabytes of memory. Just to give you an idea about the resources involved here.

The long story: Hollywood isn't designed to deal with very large images. Handling such large images requires a completely different way of storing them internally. Such large images are typically stored in several pages of memory instead of a single memory block. Hollywood isn't designed to do this so. It will always allocate a single block of memory and that's probably why it fails because the OS fails to allocate a single contiguous block of 3.5 gigabytes. It could also happen that Hollywood needs two blocks for the image in case it needs to do some pixel format conversion or so, so it could end up requiring 7 GB of memory for such large images. Hollywood isn't really designed to do this, sorry ;)
Bugala
Posts: 1181
Joined: Sun Feb 14, 2010 7:11 pm

Re: Are there some size limits in SVG files?

Post by Bugala »

Thanks for confriming this. Although the error didnt say it, I did suspect it might be a memory issue.

I was saving this image for purpose of making a very high zoom to the image. However, it can be done some different way too, was just doing it this way since it seemed like a simplest solution to do it, but now I know if I want to zoom it more, I need to do it differently, like save new file in photopea in such way as removing everything else but that thing I want to zoom into, in which case I dont need to save it in such a large size anymore.
Post Reply