You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by bu...@apache.org on 2009/07/22 00:54:22 UTC

DO NOT REPLY [Bug 47555] Bottom part of files transparent at small sizes

https://issues.apache.org/bugzilla/show_bug.cgi?id=47555


Helder Magalhães <he...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO




--- Comment #1 from Helder Magalhães <he...@gmail.com>  2009-07-21 15:54:19 PST ---
(In reply to comment #0)
> Let's take for example the following file:
> 
> <svg xmlns="http://www.w3.org/2000/svg" height="10" width="19">
> <rect width="19" height="10" fill="lime"/>
> </svg>
> 
> Obviously, this image is fully green (ff0000)

Yes, I agree with this part.


> and so should be any
> rasterisation of this image.

No, I don't agree with this. I guess there might be some confusion here between
the source image and the target canvas where the image is to be "displayed" (an
image buffer written in a file, in this particular case).

For example, the following (based in the attached sample) will fit the canvas
(using the a combination of "width" and "height" set to "100%" and the
"viewBox" [1] set coherently): 

<svg xmlns="http://www.w3.org/2000/svg"
    width="100%" height="100%" viewBox="0 0 19 10">
  <rect width="19" height="10" fill="lime"/>
</svg>

Note that the image is increased until the width *or* height touches the canvas
border. And the following will cause the image to stretch (possibly with
distortion) until the canvas is completely filled (note the
"preserveAspectRatio" [2] set to "none"):

<svg xmlns="http://www.w3.org/2000/svg"
    width="100%" height="100%" viewBox="0 0 19 10" preserveAspectRatio="none">
  <rect width="19" height="10" fill="lime"/>
</svg>


> Needless to say, this behaviour makes it difficult to align images properly
> or put a border around one, as MediaWiki does.

I understand the use case here but am not sure what is the problem here:
Batik's behavior is, as far as I know, compliant to the specification regarding
this. I'd say that wisely choosing rasterization hints and/or slightly rework
(probably a copy of) the original SVG source before rasterizing may help
assuring that the image fits the target (rasterization) canvas.


Please detail a bit on the problem (marking as need info in order to try
obtaining it), as currently this issue seems to be invalid in my opinion (and
please mark it so if you end up agreeing with the above). ;-)


[1] http://www.w3.org/TR/SVG11/coords.html#ViewBoxAttribute
[2] http://www.w3.org/TR/SVG11/coords.html#PreserveAspectRatioAttribute

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org