Re: resize/zoom ?

Bob Friesenhahn <[email protected]> Sat, 5 Dec 2020 15:36:38 -0600 (CST)
Newsgroups gmane.comp.video.graphicsmagick.help
Message-ID <[email protected]>
On Sat, 5 Dec 2020, Pro Turm wrote:

>> No, scaling of SVG is trivial.  However, you were asking for being able
> to select/crop so that just a particular region is being rendered.
> Sorry, if I could reformulate the question. Trivial zooming of a svg would
> be meaning increasing the density of the entire svg and then resize? But
> you are right, what I meant was zooming of a particular region would be not
> trivial, because it's not foreseen to control/have access to the
> viewport/viewbox of a svg (and thus tile) ?

It does not seem that density works to control the size.  What 
definitely works is to specify the 'size' property in ImageInfo.  The 
resulting image will fit in a box specified by the 'size' dimensions.

While it may be costly, it is possible to obtain the default size by 
rendering the SVG with defaults and getting its size.

SVG is pretty powerful so it should be possible to create a SVG 
wrapper and include the original SVG such that the wrapper 
controls how the original SVG is to be viewed.  So your program would 
need to write new content consisting of the wrapper SVG part around 
the original SVG part.  I think that in order to work ok with 
GraphicsMagick it would need to be rendered in one scene (rather than 
referred to by an external URL).

A Google search using the terms such as "incorporate a svg in another 
svg" or "embed a svg in another svg" shows plenty of hits.

While you need to work within the capabilities of the SVG renderer you 
are using, it is wise to be able to generate SVG which produces a 
similar result in a web browser, or in InkScape, or rsvg, or 
GraphicsMagick.

Bob
-- 
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
Public Key,     http://www.simplesystems.org/users/bfriesen/public-key.txt