Re: Images not resized properly in fop 0.94

2007-11-18 Thread Jeremias Maerki
Done: http://svn.apache.org/viewvc?rev=596100&view=rev

Thanks for the suggestion.

Jeremias Maerki



On 12.11.2007 17:22:06 Puppala, Kumar (LNG-CON) wrote:
> Thanks Jeremias for pointing me to the examples. From the examples, I
> could not find one that suits my testcase. However, I was able to find
> one from another website: 
>   http://www.renderx.net/lists/xep-support/0376.html
> 
> I tried this approach for my image and it worked. The trick is to
> specify the markup as shown below:
> 
>   content-width="scale-to-fit" 
> content-height="100%" 
> width="100%"/>
> 
> Since we do not have this particular testcase in the images.fo file, can
> you please add this? It might be helpful for those who wish to scale
> only those images that do not fit in the page.
> 
> Appreciate your help.
> 
> Thanks!!
> 
> -Original Message-
> From: Jeremias Maerki [mailto:[EMAIL PROTECTED] 
> Sent: Friday, November 09, 2007 5:00 PM
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: Images not resized properly in fop 0.94
> 
> May I suggest that you have a look at "examples/fo/basic/images.fo" in
> the FOP distribution? The example shows various ways to use
> fo:external-graphic. I'm sure you'll find the pattern you need there.
> 
> Good luck!
> 
> Jeremias Maerki
> 
> 
> 
> On 09.11.2007 22:50:23 Puppala, Kumar (LNG-CON) wrote:
> > Thanks for the information. I tried to use both content-height and
> > content-width (setting them to 'scale-to-fit') in my testcase and it
> > still did not work. I think there might be some issue here. Below is
> the
> > code snippet from AbstractGraphicsLayoutManager.java file:
> > 
> >  
> > 
> > In getInlineArea() function:
> > 
> >  
> > 
> > Line 72 onwards...
> > 
> > int bpd = -1;
> > 
> > int ipd = -1;
> > 
> >  
> > 
> > The bpd and ipd values are only overwritten if 
> > 
> > Line 129 onwards...
> > 
> > if ((scaling == EN_UNIFORM) || (cwidth == -1) || cheight ==
> -1)
> > {
> > 
> > if (cwidth == -1 && cheight == -1) {
> > 
> > cwidth = fobj.getIntrinsicWidth();
> > 
> > cheight = fobj.getIntrinsicHeight();
> > 
> > }
> > 
> >  
> > 
> > Line 164 onwards...
> > 
> > if (ipd == -1) {
> > 
> > ipd = cwidth;
> > 
> > }
> > 
> > if (bpd == -1) {
> > 
> > bpd = cheight;
> > 
> > }
> > 
> >  
> > 
> > The ipd and bpd values are set as per this flow for my FO file. As
> such,
> > the values are not being scaled. We might be missing something here
> but
> > since I am not an expert in this area, any input to fix this issue
> will
> > be greatly appreciated.
> > 
> >  
> > 
> >  
> > 
> > Thanks,
> > 
> > Kumar Puppala
> > 
> >  
> > 
> > -Original Message-
> > From: Andreas L Delmelle [mailto:[EMAIL PROTECTED] 
> > Sent: Friday, November 09, 2007 2:21 PM
> > To: fop-users@xmlgraphics.apache.org
> > Subject: Re: Images not resized properly in fop 0.94
> > 
> >  
> > 
> > On Nov 9, 2007, at 20:08, Puppala, Kumar (LNG-CON) wrote:
> > 
> >  
> > 
> > Hi Kumar
> > 
> > > I am running into an issue with both gif and png images in fop  
> > 
> > > 0.94. I am trying to render a big GIF image in my PDF document.  
> > 
> > > Since the image does not fit in a single page, it should be  
> > 
> > > resized. In FOP 0.20.5, I do see the correct behavior and the image
> 
> > 
> > > is rendered properly. However in both 0.93 and 0.94 releases, the  
> > 
> > > image is not truncated and hence only rendered partially. I am  
> > 
> > > hereby attaching the FO file and the outputs from old and new fop.  
> > 
> > > Are there any known issues here?
> > 
> >  
> > 
> > Yes, the behavior in FOP 0.20.5 is non-compliant.
> > 
> >  
> > 
> > Take a look at the fo:external-graphic, and the XSL-FO Rec, more  
> > 
> > precisely:
> > 
> >  
> > 
> > http://www.w3.org/TR/xsl11/#d0e22982 (Area Dimension Properties)
> > 
> >  
> > 
> > You have no explicit (content-)width/height, so:
> > 
> >  
> > 
> > content-width="auto&quo

RE: Images not resized properly in fop 0.94

2007-11-12 Thread Puppala, Kumar (LNG-CON)
Thanks Jeremias for pointing me to the examples. From the examples, I
could not find one that suits my testcase. However, I was able to find
one from another website: 
  http://www.renderx.net/lists/xep-support/0376.html

I tried this approach for my image and it worked. The trick is to
specify the markup as shown below:

 

Since we do not have this particular testcase in the images.fo file, can
you please add this? It might be helpful for those who wish to scale
only those images that do not fit in the page.

Appreciate your help.

Thanks!!

-Original Message-
From: Jeremias Maerki [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 09, 2007 5:00 PM
To: fop-users@xmlgraphics.apache.org
Subject: Re: Images not resized properly in fop 0.94

May I suggest that you have a look at "examples/fo/basic/images.fo" in
the FOP distribution? The example shows various ways to use
fo:external-graphic. I'm sure you'll find the pattern you need there.

Good luck!

Jeremias Maerki



On 09.11.2007 22:50:23 Puppala, Kumar (LNG-CON) wrote:
> Thanks for the information. I tried to use both content-height and
> content-width (setting them to 'scale-to-fit') in my testcase and it
> still did not work. I think there might be some issue here. Below is
the
> code snippet from AbstractGraphicsLayoutManager.java file:
> 
>  
> 
> In getInlineArea() function:
> 
>  
> 
> Line 72 onwards...
> 
> int bpd = -1;
> 
> int ipd = -1;
> 
>  
> 
> The bpd and ipd values are only overwritten if 
> 
> Line 129 onwards...
> 
> if ((scaling == EN_UNIFORM) || (cwidth == -1) || cheight ==
-1)
> {
> 
> if (cwidth == -1 && cheight == -1) {
> 
> cwidth = fobj.getIntrinsicWidth();
> 
> cheight = fobj.getIntrinsicHeight();
> 
> }
> 
>  
> 
> Line 164 onwards...
> 
> if (ipd == -1) {
> 
> ipd = cwidth;
> 
> }
> 
> if (bpd == -1) {
> 
> bpd = cheight;
> 
> }
> 
>  
> 
> The ipd and bpd values are set as per this flow for my FO file. As
such,
> the values are not being scaled. We might be missing something here
but
> since I am not an expert in this area, any input to fix this issue
will
> be greatly appreciated.
> 
>  
> 
>  
> 
> Thanks,
> 
> Kumar Puppala
> 
>  
> 
> -Original Message-
> From: Andreas L Delmelle [mailto:[EMAIL PROTECTED] 
> Sent: Friday, November 09, 2007 2:21 PM
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: Images not resized properly in fop 0.94
> 
>  
> 
> On Nov 9, 2007, at 20:08, Puppala, Kumar (LNG-CON) wrote:
> 
>  
> 
> Hi Kumar
> 
> > I am running into an issue with both gif and png images in fop  
> 
> > 0.94. I am trying to render a big GIF image in my PDF document.  
> 
> > Since the image does not fit in a single page, it should be  
> 
> > resized. In FOP 0.20.5, I do see the correct behavior and the image

> 
> > is rendered properly. However in both 0.93 and 0.94 releases, the  
> 
> > image is not truncated and hence only rendered partially. I am  
> 
> > hereby attaching the FO file and the outputs from old and new fop.  
> 
> > Are there any known issues here?
> 
>  
> 
> Yes, the behavior in FOP 0.20.5 is non-compliant.
> 
>  
> 
> Take a look at the fo:external-graphic, and the XSL-FO Rec, more  
> 
> precisely:
> 
>  
> 
> http://www.w3.org/TR/xsl11/#d0e22982 (Area Dimension Properties)
> 
>  
> 
> You have no explicit (content-)width/height, so:
> 
>  
> 
> content-width="auto" => intrinsic image width
> 
> content-height="auto" => intrinsic image height
> 
> height="auto"
> 
> width="auto"
> 
>  
> 
> => the image should not be scaled to fit the viewport, but clipped.
> 
>  
> 
> The trick is to set content-height and/or content-width explicitly to

> 
> "scale-to-fit". That should normally do it.
> 
>  
> 
> Hope this helps!
> 
>  
> 
>  
> 
> Andreas


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Images not resized properly in fop 0.94

2007-11-09 Thread Jeremias Maerki
May I suggest that you have a look at "examples/fo/basic/images.fo" in
the FOP distribution? The example shows various ways to use
fo:external-graphic. I'm sure you'll find the pattern you need there.

Good luck!

Jeremias Maerki



On 09.11.2007 22:50:23 Puppala, Kumar (LNG-CON) wrote:
> Thanks for the information. I tried to use both content-height and
> content-width (setting them to 'scale-to-fit') in my testcase and it
> still did not work. I think there might be some issue here. Below is the
> code snippet from AbstractGraphicsLayoutManager.java file:
> 
>  
> 
> In getInlineArea() function:
> 
>  
> 
> Line 72 onwards...
> 
> int bpd = -1;
> 
> int ipd = -1;
> 
>  
> 
> The bpd and ipd values are only overwritten if 
> 
> Line 129 onwards...
> 
> if ((scaling == EN_UNIFORM) || (cwidth == -1) || cheight == -1)
> {
> 
> if (cwidth == -1 && cheight == -1) {
> 
> cwidth = fobj.getIntrinsicWidth();
> 
> cheight = fobj.getIntrinsicHeight();
> 
> }
> 
>  
> 
> Line 164 onwards...
> 
> if (ipd == -1) {
> 
> ipd = cwidth;
> 
> }
> 
> if (bpd == -1) {
> 
> bpd = cheight;
> 
> }
> 
>  
> 
> The ipd and bpd values are set as per this flow for my FO file. As such,
> the values are not being scaled. We might be missing something here but
> since I am not an expert in this area, any input to fix this issue will
> be greatly appreciated.
> 
>  
> 
>  
> 
> Thanks,
> 
> Kumar Puppala
> 
>  
> 
> -Original Message-
> From: Andreas L Delmelle [mailto:[EMAIL PROTECTED] 
> Sent: Friday, November 09, 2007 2:21 PM
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: Images not resized properly in fop 0.94
> 
>  
> 
> On Nov 9, 2007, at 20:08, Puppala, Kumar (LNG-CON) wrote:
> 
>  
> 
> Hi Kumar
> 
> > I am running into an issue with both gif and png images in fop  
> 
> > 0.94. I am trying to render a big GIF image in my PDF document.  
> 
> > Since the image does not fit in a single page, it should be  
> 
> > resized. In FOP 0.20.5, I do see the correct behavior and the image  
> 
> > is rendered properly. However in both 0.93 and 0.94 releases, the  
> 
> > image is not truncated and hence only rendered partially. I am  
> 
> > hereby attaching the FO file and the outputs from old and new fop.  
> 
> > Are there any known issues here?
> 
>  
> 
> Yes, the behavior in FOP 0.20.5 is non-compliant.
> 
>  
> 
> Take a look at the fo:external-graphic, and the XSL-FO Rec, more  
> 
> precisely:
> 
>  
> 
> http://www.w3.org/TR/xsl11/#d0e22982 (Area Dimension Properties)
> 
>  
> 
> You have no explicit (content-)width/height, so:
> 
>  
> 
> content-width="auto" => intrinsic image width
> 
> content-height="auto" => intrinsic image height
> 
> height="auto"
> 
> width="auto"
> 
>  
> 
> => the image should not be scaled to fit the viewport, but clipped.
> 
>  
> 
> The trick is to set content-height and/or content-width explicitly to  
> 
> "scale-to-fit". That should normally do it.
> 
>  
> 
> Hope this helps!
> 
>  
> 
>  
> 
> Andreas


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Images not resized properly in fop 0.94

2007-11-09 Thread Puppala, Kumar (LNG-CON)
Thanks for the information. I tried to use both content-height and
content-width (setting them to 'scale-to-fit') in my testcase and it
still did not work. I think there might be some issue here. Below is the
code snippet from AbstractGraphicsLayoutManager.java file:

 

In getInlineArea() function:

 

Line 72 onwards...

int bpd = -1;

int ipd = -1;

 

The bpd and ipd values are only overwritten if 

Line 129 onwards...

if ((scaling == EN_UNIFORM) || (cwidth == -1) || cheight == -1)
{

if (cwidth == -1 && cheight == -1) {

cwidth = fobj.getIntrinsicWidth();

cheight = fobj.getIntrinsicHeight();

}

 

Line 164 onwards...

if (ipd == -1) {

ipd = cwidth;

}

if (bpd == -1) {

bpd = cheight;

}

 

The ipd and bpd values are set as per this flow for my FO file. As such,
the values are not being scaled. We might be missing something here but
since I am not an expert in this area, any input to fix this issue will
be greatly appreciated.

 

 

Thanks,

Kumar Puppala

 

-Original Message-
From: Andreas L Delmelle [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 09, 2007 2:21 PM
To: fop-users@xmlgraphics.apache.org
Subject: Re: Images not resized properly in fop 0.94

 

On Nov 9, 2007, at 20:08, Puppala, Kumar (LNG-CON) wrote:

 

Hi Kumar

> I am running into an issue with both gif and png images in fop  

> 0.94. I am trying to render a big GIF image in my PDF document.  

> Since the image does not fit in a single page, it should be  

> resized. In FOP 0.20.5, I do see the correct behavior and the image  

> is rendered properly. However in both 0.93 and 0.94 releases, the  

> image is not truncated and hence only rendered partially. I am  

> hereby attaching the FO file and the outputs from old and new fop.  

> Are there any known issues here?

 

Yes, the behavior in FOP 0.20.5 is non-compliant.

 

Take a look at the fo:external-graphic, and the XSL-FO Rec, more  

precisely:

 

http://www.w3.org/TR/xsl11/#d0e22982 (Area Dimension Properties)

 

You have no explicit (content-)width/height, so:

 

content-width="auto" => intrinsic image width

content-height="auto" => intrinsic image height

height="auto"

width="auto"

 

=> the image should not be scaled to fit the viewport, but clipped.

 

The trick is to set content-height and/or content-width explicitly to  

"scale-to-fit". That should normally do it.

 

Hope this helps!

 

 

Andreas

 

 

-

To unsubscribe, e-mail: [EMAIL PROTECTED]

For additional commands, e-mail: [EMAIL PROTECTED]

 



Re: Images not resized properly in fop 0.94

2007-11-09 Thread Andreas L Delmelle

On Nov 9, 2007, at 20:08, Puppala, Kumar (LNG-CON) wrote:

Hi Kumar
I am running into an issue with both gif and png images in fop  
0.94. I am trying to render a big GIF image in my PDF document.  
Since the image does not fit in a single page, it should be  
resized. In FOP 0.20.5, I do see the correct behavior and the image  
is rendered properly. However in both 0.93 and 0.94 releases, the  
image is not truncated and hence only rendered partially. I am  
hereby attaching the FO file and the outputs from old and new fop.  
Are there any known issues here?


Yes, the behavior in FOP 0.20.5 is non-compliant.

Take a look at the fo:external-graphic, and the XSL-FO Rec, more  
precisely:


http://www.w3.org/TR/xsl11/#d0e22982 (Area Dimension Properties)

You have no explicit (content-)width/height, so:

content-width="auto" => intrinsic image width
content-height="auto" => intrinsic image height
height="auto"
width="auto"

=> the image should not be scaled to fit the viewport, but clipped.

The trick is to set content-height and/or content-width explicitly to  
"scale-to-fit". That should normally do it.


Hope this helps!


Andreas


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]