You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Jan Tošovský <j....@tiscali.cz> on 2009/03/11 21:16:16 UTC

Portrait rotation

Hello Everyone,

I've tried Batik rasterizer to convert my SVG file with embeded portrait
image (taken from rotated digital camera), but resulted JPEG image is
without rotation, rasterized as normal landscape image. AFAIK there is no
option to switch this on. I am missing something? Now I use another tool for
resaving such image, but it affects the final quality. Thank for any ideas.

Jan


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Portrait rotation

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 14.03.2009 16:32:56 Jan Tošovský wrote:
<snip/>
> > Thing is Batik isn't exactly an image viewer so, without investigating
> > properly, I'd say that the Exif orientation metadata [2] might not be
> > supported.
> 
> I was afraid that it is unsupported. It is pity...

You know, this is open source: you can always add that feature yourself
and submit a patch. That's how projects evolve.

<snip/>


Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


RE: Portrait rotation

Posted by Jan Tošovský <j....@tiscali.cz>.
Hi Helder,

thanks for your patience. 

> It's still unclear (at least to me) what are you trying to do.

The SVG file in my case is a versatile template. There is a rectangle area
for embedding the external bitmap graphics and its properties are set to
scale down or up the reffered image to the whole available area. What is
larger it is cropped. I cannot use any hardcoded rotation transformation as
it isn't known which one image will need rotation (it will be processed in a
batch).

Sample svg can be obtained here: http://nio.astronomy.cz/batik/poster.svg -
although the reffered image is a portrait image (with proper Exif rotation
info), it is placed as landscape. The result of rasterization is here:
http://nio.astronomy.cz/batik/poster.jpg (the same as in Firefox), but
expected result is here:
http://nio.astronomy.cz/batik/poster_portrait_in_lanscape_area.jpg

> Thing is Batik isn't exactly an image viewer so, without investigating
> properly, I'd say that the Exif orientation metadata [2] might not be
> supported.

I was afraid that it is unsupported. It is pity...

Jan


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Portrait rotation

Posted by Helder Magalhães <he...@gmail.com>.
Hi Jan,

> thanks for your links, although it is not my case, it helped me to name my problem at least.
> I've met there keyword Exif orientation. It seems to me that this info is not read from the image
> (like in IrfanView and other tools) so I am getting not rotated output.
> Is this Exif info supported? Are even older versions of this specification supported?
> Image was taken by 5 years old Canon Ixus V3.

It's still unclear (at least to me) what are you trying to do. In
general, one should explain the goal, not the particular step in which
something didn't go as expected [1]. Providing more information and/or
samples would probably help: what's the use case, attach a sample
image taken with that camera, etc..

Thing is Batik isn't exactly an image viewer so, without investigating
properly, I'd say that the Exif orientation metadata [2] might not be
supported. On the other hand, by using an SVG transform as stated in
my previous message, you may be able to workaround the (potential)
issue.

Maybe Thomas DeWeese (expert in SVGGraphics2D and Rasterizer [2]) can
shed some light on this, but this will likely be difficult without
having more details. Please take the time to explain what you intend
(from the start, not from the particular orientation issue).

Regards,
 Helder Magalhães

[1] http://www.catb.org/~esr/faqs/smart-questions.html#goal
[2] http://sylvana.net/jpegcrop/exif_orientation.html
[3] http://xmlgraphics.apache.org/batik/contributors.html#expertise

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


RE: Portrait rotation

Posted by Jan Tošovský <j....@tiscali.cz>.
Hi Helder, 

thanks for your links, although it is not my case, it helped me to name my problem at least. I've met there keyword Exif orientation. It seems to me that this info is not read from the image (like in IrfanView and other tools) so I am getting not rotated output. Is this Exif info supported? Are even older versions of this specification supported? Image was taken by 5 years old Canon Ixus V3.

Thanks in advance for any feedback.

Jan

> > I've tried Batik rasterizer to convert my SVG file with 
> embeded portrait
> > image (taken from rotated digital camera), but resulted 
> JPEG image is
> > without rotation, rasterized as normal landscape image. 
> AFAIK there is no
> > option to switch this on. I am missing something? Now I use 
> another tool for
> > resaving such image, but it affects the final quality. 
> Thank for any ideas.
> 
> Am not sure about the use case here... Do you intend to do a lossless
> JPEG rotation [1] [2] [3]? If that's not the case, to rotate an
> embedded image one can use the transform [4] property set in a
> container element [5]. Sample follows:
> 
> <svg xmlns="http://www.w3.org/2000/svg"
> xmlns:xlink="http://www.w3.org/1999/xlink">
>   <title>image rotation sample</title>
>   <g transform="rotate(-45)">
>     <image x="0" y="0" width="100px" height="100px"
> xlink:href="my100x100image.jpeg">
>   </g>
> 
> Maybe it's me who's missing something -- if none of this was the
> intended idea, please provide more details, maybe accompanied by a
> sample or two, in order to get more valuable feedback.
> 
> Hope this helps,
>  Helder Magalhães
> 
> [1] 
> http://www.ammara.com/support/technologies/lossless-jpeg-rotation.html
> [2] 
> http://graphicssoft.about.com/cs/digitalimaging/f/rotatequality.htm
> [3] http://jpegclub.org/losslessapps.html
> [4] http://www.w3.org/TR/SVG11/coords.html#TransformAttribute
> [5] http://www.w3.org/TR/SVG11/intro.html#TermContainerElement


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Portrait rotation

Posted by Helder Magalhães <he...@gmail.com>.
Hi Jan

> I've tried Batik rasterizer to convert my SVG file with embeded portrait
> image (taken from rotated digital camera), but resulted JPEG image is
> without rotation, rasterized as normal landscape image. AFAIK there is no
> option to switch this on. I am missing something? Now I use another tool for
> resaving such image, but it affects the final quality. Thank for any ideas.

Am not sure about the use case here... Do you intend to do a lossless
JPEG rotation [1] [2] [3]? If that's not the case, to rotate an
embedded image one can use the transform [4] property set in a
container element [5]. Sample follows:

<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
  <title>image rotation sample</title>
  <g transform="rotate(-45)">
    <image x="0" y="0" width="100px" height="100px"
xlink:href="my100x100image.jpeg">
  </g>

Maybe it's me who's missing something -- if none of this was the
intended idea, please provide more details, maybe accompanied by a
sample or two, in order to get more valuable feedback.

Hope this helps,
 Helder Magalhães

[1] http://www.ammara.com/support/technologies/lossless-jpeg-rotation.html
[2] http://graphicssoft.about.com/cs/digitalimaging/f/rotatequality.htm
[3] http://jpegclub.org/losslessapps.html
[4] http://www.w3.org/TR/SVG11/coords.html#TransformAttribute
[5] http://www.w3.org/TR/SVG11/intro.html#TermContainerElement

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org