Re: [PATCH] Re: Graphics: Viewing XPM and stray-EPS files ?!?!

2002-04-21 Thread Herbert Voss

R. Lahaye wrote:

 In addition, I have patched lib/configure.m4 further by adding
 more conversion-schemes for Grace. From Grace (agr) to EPS,
 PDF, PNG and JPEG (only if Grace itself and each of these output
 formats are available).
 
 Would that be of help?


when does LyX needs a conversion agr-jpg?

Herbert



-- 
http://www.lyx.org/help/




Re: [PATCH] Re: Graphics: Viewing XPM and stray-EPS files ?!?!

2002-04-21 Thread R. Lahaye

Herbert Voss wrote:
 
 R. Lahaye wrote:
 
  In addition, I have patched lib/configure.m4 further by adding
  more conversion-schemes for Grace. From Grace (agr) to EPS,
  PDF, PNG and JPEG (only if Grace itself and each of these output
  formats are available).
 
  Would that be of help?
 
 when does LyX needs a conversion agr-jpg?

Good question. I added it, because JPEG was there in Grace.
That should go then if not useful in LyX.
Are the other Grace conversions still convenient?

If so, then we don't need another patch for lib/configure.m4,
do we? Simply apply my latest patch and remove the two lines
that contain agr_to_jpg (lines 578 and 411).

Regards,
Rob.

PS: the patch also contains the conversion from XPM to EPS,
which is really necessary; otherwise xpm graphics cannot be
viewed or printed!



Re: [PATCH] Re: Graphics: Viewing XPM and stray-EPS files ?!?!

2002-04-21 Thread Herbert Voss

R. Lahaye wrote:

> In addition, I have patched lib/configure.m4 further by adding
> more conversion-schemes for Grace. From Grace (agr) to EPS,
> PDF, PNG and JPEG (only if Grace itself and each of these output
> formats are available).
> 
> Would that be of help?


when does LyX needs a conversion agr->jpg?

Herbert



-- 
http://www.lyx.org/help/




Re: [PATCH] Re: Graphics: Viewing XPM and stray-EPS files ?!?!

2002-04-21 Thread R. Lahaye

Herbert Voss wrote:
> 
> R. Lahaye wrote:
> 
> > In addition, I have patched lib/configure.m4 further by adding
> > more conversion-schemes for Grace. From Grace (agr) to EPS,
> > PDF, PNG and JPEG (only if Grace itself and each of these output
> > formats are available).
> >
> > Would that be of help?
> 
> when does LyX needs a conversion agr->jpg?

Good question. I added it, because JPEG was there in Grace.
That should go then if not useful in LyX.
Are the other Grace conversions still convenient?

If so, then we don't need another patch for lib/configure.m4,
do we? Simply apply my latest patch and remove the two lines
that contain "agr_to_jpg" (lines 578 and 411).

Regards,
Rob.

PS: the patch also contains the conversion from XPM to EPS,
which is really necessary; otherwise xpm graphics cannot be
viewed or printed!



Re: [PATCH] Re: Graphics: Viewing XPM and stray-EPS files ?!?!

2002-04-20 Thread R. Lahaye

R. Lahaye wrote:
 [Adding xpm to eps]
 
 Hi,
 
 I have modified lib/configure.m4 so that it also includes the conversion
 from XPM to EPS by default, at least for ImageMagick's convert:
 
 convert XPM:$$i EPS:$$o
 
 Do we also need a netpbm equivalent? Angus?
 
 This conversion is required, when loading XPM files and viewing/printing
 them to Postscript.
 
 Patch attached.

In addition, I have patched lib/configure.m4 further by adding
more conversion-schemes for Grace. From Grace (agr) to EPS,
PDF, PNG and JPEG (only if Grace itself and each of these output
formats are available).

Would that be of help?
If so, then do not apply previous patch, but only this one.
This one has all diffs with unpatched CVS.

Regards,
Rob.


configure_m4.diff.gz
Description: GNU Zip compressed data


Re: [PATCH] Re: Graphics: Viewing XPM and stray-EPS files ?!?!

2002-04-20 Thread R. Lahaye

R. Lahaye wrote:
> [Adding xpm to eps]
> 
> Hi,
> 
> I have modified lib/configure.m4 so that it also includes the conversion
> from XPM to EPS by default, at least for ImageMagick's convert:
> 
> convert XPM:$$i EPS:$$o
> 
> Do we also need a netpbm equivalent? Angus?
> 
> This conversion is required, when loading XPM files and viewing/printing
> them to Postscript.
> 
> Patch attached.

In addition, I have patched lib/configure.m4 further by adding
more conversion-schemes for Grace. From Grace (agr) to EPS,
PDF, PNG and JPEG (only if Grace itself and each of these output
formats are available).

Would that be of help?
If so, then do not apply previous patch, but only this one.
This one has all diffs with unpatched CVS.

Regards,
Rob.


configure_m4.diff.gz
Description: GNU Zip compressed data


Re: [PATCH] Re: Graphics: file loading problems

2002-04-15 Thread Angus Leeming

On Monday 15 April 2002 4:22 pm, R. Lahaye wrote:
 Angus Leeming wrote:
  Bingo! xforms 0.88 has noimage  support. You're using the image loader I
  wrote based on the libXpm library. The relevant code is to be found in
  src/graphics/GraphicsImageXPM.C.

 $Bingo^2$ !! Thanks for your hints and help.

 Instead of

dimension const * start_row = old_data;

 we need

 dimension const * start_row = old_data
 + image_.width() * (image_.height() -
 params.bb.yt);

dimension const * start_row = old_data + image_.width() * 
(image_.height() - params.bb.yt);

Excuse me a momement, but why is that:
(image_.height() - params.bb.yt)
not
params.bb.yb
?

Angus



Re: [PATCH] Re: Graphics: file loading problems

2002-04-15 Thread R. Lahaye

Angus Leeming wrote:
 
 On Monday 15 April 2002 4:22 pm, R. Lahaye wrote:
  Angus Leeming wrote:
   Bingo! xforms 0.88 has noimage  support. You're using the image loader I
   wrote based on the libXpm library. The relevant code is to be found in
   src/graphics/GraphicsImageXPM.C.
 
  $Bingo^2$ !! Thanks for your hints and help.
 
  Instead of
 
 dimension const * start_row = old_data;
 
  we need
 
  dimension const * start_row = old_data
  + image_.width() * (image_.height() -
  params.bb.yt);
 
 dimension const * start_row = old_data + image_.width() *
 (image_.height() - params.bb.yt);
 
 Excuse me a momement, but why is that:
 (image_.height() - params.bb.yt)
 not
 params.bb.yb
 ?

Ah, took me also some time to realize.
The picture is stored in memory from upper-left to lower-right
(see attachement).
Horizontally you still run from xl to xr, but vertically
you run from yt to yb, NOT reversed as you're thinking.
So you have to recalculate from the top, not the bottom.
The top is height - yt.

Does that make sense to you?

The patch works beautifully here!

Regards,
Rob.



 Angus

-- 
dr. R.J.W.E. Lahaye
Center for Ion-Surface Reaction 
Department of Chemistry
Pohang University of Science and Technology
San 31 Hyojadong, Namgu
790-784 Pohang, Kyungbuk
Republic of Korea

Tel : +82-54-279-2780
Fax : +82-54-279-8157
email: [EMAIL PROTECTED]



Re: [PATCH] Re: Graphics: file loading problems

2002-04-15 Thread Angus Leeming

On Monday 15 April 2002 5:37 pm, R. Lahaye wrote:
  Excuse me a momement, but why is that:
  (image_.height() - params.bb.yt)
  not
  params.bb.yb
  ?

 Ah, took me also some time to realize.
 The picture is stored in memory from upper-left to lower-right
 (see attachement).
 Horizontally you still run from xl to xr, but vertically
 you run from yt to yb, NOT reversed as you're thinking.
 So you have to recalculate from the top, not the bottom.
 The top is height - yt.

 Does that make sense to you?

Indeed. I probably knew this once upon a time, but my mind is like a seive 
and it's easier to question than to remember.

 The patch works beautifully here!

And here. I'll apply presently.
Angus


 Regards,
 Rob.

  Angus



Re: [PATCH] Re: Graphics: file loading problems

2002-04-15 Thread Angus Leeming

On Monday 15 April 2002 4:22 pm, R. Lahaye wrote:
> Angus Leeming wrote:
> > Bingo! xforms 0.88 has noimage  support. You're using the image loader I
> > wrote based on the libXpm library. The relevant code is to be found in
> > src/graphics/GraphicsImageXPM.C.
>
> $Bingo^2$ !! Thanks for your hints and help.
>
> Instead of
>
>dimension const * start_row = old_data;
>
> we need
>
> dimension const * start_row = old_data
> + image_.width() * (image_.height() -
> params.bb.yt);

dimension const * start_row = old_data + image_.width() * 
(image_.height() - params.bb.yt);

Excuse me a momement, but why is that:
(image_.height() - params.bb.yt)
not
params.bb.yb
?

Angus



Re: [PATCH] Re: Graphics: file loading problems

2002-04-15 Thread R. Lahaye

Angus Leeming wrote:
> 
> On Monday 15 April 2002 4:22 pm, R. Lahaye wrote:
> > Angus Leeming wrote:
> > > Bingo! xforms 0.88 has noimage  support. You're using the image loader I
> > > wrote based on the libXpm library. The relevant code is to be found in
> > > src/graphics/GraphicsImageXPM.C.
> >
> > $Bingo^2$ !! Thanks for your hints and help.
> >
> > Instead of
> >
> >dimension const * start_row = old_data;
> >
> > we need
> >
> > dimension const * start_row = old_data
> > + image_.width() * (image_.height() -
> > params.bb.yt);
> 
> dimension const * start_row = old_data + image_.width() *
> (image_.height() - params.bb.yt);
> 
> Excuse me a momement, but why is that:
> (image_.height() - params.bb.yt)
> not
> params.bb.yb
> ?

Ah, took me also some time to realize.
The picture is stored in memory from upper-left to lower-right
(see attachement).
Horizontally you still run from xl to xr, but vertically
you run from yt to yb, NOT reversed as you're thinking.
So you have to recalculate from the top, not the bottom.
The top is "height - yt".

Does that make sense to you?

The patch works beautifully here!

Regards,
Rob.



> Angus

-- 
dr. R.J.W.E. Lahaye
Center for Ion-Surface Reaction 
Department of Chemistry
Pohang University of Science and Technology
San 31 Hyojadong, Namgu
790-784 Pohang, Kyungbuk
Republic of Korea

Tel : +82-54-279-2780
Fax : +82-54-279-8157
email: [EMAIL PROTECTED]



Re: [PATCH] Re: Graphics: file loading problems

2002-04-15 Thread Angus Leeming

On Monday 15 April 2002 5:37 pm, R. Lahaye wrote:
> > Excuse me a momement, but why is that:
> > (image_.height() - params.bb.yt)
> > not
> > params.bb.yb
> > ?
>
> Ah, took me also some time to realize.
> The picture is stored in memory from upper-left to lower-right
> (see attachement).
> Horizontally you still run from xl to xr, but vertically
> you run from yt to yb, NOT reversed as you're thinking.
> So you have to recalculate from the top, not the bottom.
> The top is "height - yt".
>
> Does that make sense to you?

Indeed. I probably knew this once upon a time, but my mind is like a seive 
and it's easier to question than to remember.
>
> The patch works beautifully here!

And here. I'll apply presently.
Angus

>
> Regards,
> Rob.
>
> > Angus



Re: [PATCH] Re: Graphics: Get boundingbox from file for non-eps ?

2002-04-11 Thread Jean-Marc Lasgouttes

 Herbert == Herbert Voss [EMAIL PROTECTED] writes:

Herbert R. Lahaye wrote:
 Talking about conversions again: do you know why we have two Grace
 formats listed in Preferences-Conversion-Formats? There is an
 entry for GRACE and for agr. What is the difference between the
 two? Moreover, only agr is used in the Converters.


Herbert please apply

Will do it.

JMarc



Re: [PATCH] Re: Graphics: Get boundingbox from file for non-eps ?

2002-04-11 Thread Angus Leeming

On Thursday 11 April 2002 4:19 pm, Herbert Voss wrote:
 Angus Leeming wrote:
  Or call them raw_dimensions and return a pairuint, uint. Your call.

 please apply.

 Herbert

I've done so. Needless to say I tweaked it a little. I decided that the 
graphics dialog could access the graphics cache direct and not go through the 
inset.

Regards,
Angus



Re: [PATCH] Re: Graphics: Get boundingbox from file for non-eps ?

2002-04-11 Thread Herbert Voss

Angus Leeming wrote:

 I've done so. Needless to say I tweaked it a little. I decided that the 
 graphics dialog could access the graphics cache direct and not go through the 
 inset.


ok, good idea.


Angus, what is with the former graphics patch?

Herbert

-- 
http://www.lyx.org/help/




Re: [PATCH] Re: Graphics: Get boundingbox from file for non-eps ?

2002-04-11 Thread Angus Leeming

On Thursday 11 April 2002 7:54 pm, Herbert Voss wrote:
 Angus Leeming wrote:
  I've done so. Needless to say I tweaked it a little. I decided that the
  graphics dialog could access the graphics cache direct and not go through
  the inset.

 ok, good idea.


 Angus, what is with the former graphics patch?

 Herbert

I'm looking at it at this instant. I'll address my issues and commit it in 
the next 20 mins or so.

A



Re: [PATCH] Re: Graphics: Get boundingbox from file for non-eps ?

2002-04-11 Thread Herbert Voss

Angus Leeming wrote:

 
 I'm looking at it at this instant. I'll address my issues and commit it in 
 the next 20 mins or so.


ok

Angus, I forgot to ask for the sense of this message:

Received unhandled X11 event
Type: 0xd Target: 0x35f

happens, when applying a graphic from the gui.

Herbert



-- 
http://www.lyx.org/help/




Re: [PATCH] Re: Graphics: Get boundingbox from file for non-eps ?

2002-04-11 Thread Angus Leeming

On Thursday 11 April 2002 8:08 pm, Herbert Voss wrote:
 Angus Leeming wrote:
  I'm looking at it at this instant. I'll address my issues and commit it
  in the next 20 mins or so.

 ok

 Angus, I forgot to ask for the sense of this message:

 Received unhandled X11 event
 Type: 0xd Target: 0x35f

 happens, when applying a graphic from the gui.

 Herbert

I know little or nothing about such X11 messages. John Levon is the guru!

Angus



Re: [PATCH] Re: Graphics: Get boundingbox from file for non-eps ?

2002-04-11 Thread John Levon

On Thu, Apr 11, 2002 at 07:07:48PM +0100, Angus Leeming wrote:

  Received unhandled X11 event
  Type: 0xd Target: 0x35f
 
 I know little or nothing about such X11 messages. John Levon is the guru!

*cough*

Anyway, it's just the remnants of the BadWindow xforms bug, it looks
like.

It can be ignored. We shouldn't quieten it though, it is there to remind
us that this is an error condition

regards
john

-- 
I never understood what's so hard about picking a unique
 first and last name - and not going beyond the 6 character limit.
- Toon Moene



Re: [PATCH] Re: Graphics: "Get boundingbox from file" for non-eps ?

2002-04-11 Thread Jean-Marc Lasgouttes

> "Herbert" == Herbert Voss <[EMAIL PROTECTED]> writes:

Herbert> R. Lahaye wrote:
>> Talking about conversions again: do you know why we have two Grace
>> formats listed in Preferences->Conversion->Formats? There is an
>> entry for "GRACE" and for "agr". What is the difference between the
>> two? Moreover, only "agr" is used in the "Converters".


Herbert> please apply

Will do it.

JMarc



Re: [PATCH] Re: Graphics: "Get boundingbox from file" for non-eps ?

2002-04-11 Thread Angus Leeming

On Thursday 11 April 2002 4:19 pm, Herbert Voss wrote:
> Angus Leeming wrote:
> > Or call them raw_dimensions and return a pair. Your call.
>
> please apply.
>
> Herbert

I've done so. Needless to say I tweaked it a little. I decided that the 
graphics dialog could access the graphics cache direct and not go through the 
inset.

Regards,
Angus



Re: [PATCH] Re: Graphics: "Get boundingbox from file" for non-eps ?

2002-04-11 Thread Herbert Voss

Angus Leeming wrote:

> I've done so. Needless to say I tweaked it a little. I decided that the 
> graphics dialog could access the graphics cache direct and not go through the 
> inset.


ok, good idea.


Angus, what is with the former graphics patch?

Herbert

-- 
http://www.lyx.org/help/




Re: [PATCH] Re: Graphics: "Get boundingbox from file" for non-eps ?

2002-04-11 Thread Angus Leeming

On Thursday 11 April 2002 7:54 pm, Herbert Voss wrote:
> Angus Leeming wrote:
> > I've done so. Needless to say I tweaked it a little. I decided that the
> > graphics dialog could access the graphics cache direct and not go through
> > the inset.
>
> ok, good idea.
>
>
> Angus, what is with the former graphics patch?
>
> Herbert

I'm looking at it at this instant. I'll address my issues and commit it in 
the next 20 mins or so.

A



Re: [PATCH] Re: Graphics: "Get boundingbox from file" for non-eps ?

2002-04-11 Thread Herbert Voss

Angus Leeming wrote:

> 
> I'm looking at it at this instant. I'll address my issues and commit it in 
> the next 20 mins or so.


ok

Angus, I forgot to ask for the sense of this message:

Received unhandled X11 event
Type: 0xd Target: 0x35f

happens, when applying a graphic from the gui.

Herbert



-- 
http://www.lyx.org/help/




Re: [PATCH] Re: Graphics: "Get boundingbox from file" for non-eps ?

2002-04-11 Thread Angus Leeming

On Thursday 11 April 2002 8:08 pm, Herbert Voss wrote:
> Angus Leeming wrote:
> > I'm looking at it at this instant. I'll address my issues and commit it
> > in the next 20 mins or so.
>
> ok
>
> Angus, I forgot to ask for the sense of this message:
>
> Received unhandled X11 event
> Type: 0xd Target: 0x35f
>
> happens, when applying a graphic from the gui.
>
> Herbert

I know little or nothing about such X11 messages. John Levon is the guru!

Angus



Re: [PATCH] Re: Graphics: "Get boundingbox from file" for non-eps ?

2002-04-11 Thread John Levon

On Thu, Apr 11, 2002 at 07:07:48PM +0100, Angus Leeming wrote:

> > Received unhandled X11 event
> > Type: 0xd Target: 0x35f
> 
> I know little or nothing about such X11 messages. John Levon is the guru!

*cough*

Anyway, it's just the remnants of the BadWindow xforms bug, it looks
like.

It can be ignored. We shouldn't quieten it though, it is there to remind
us that this is an error condition

regards
john

-- 
"I never understood what's so hard about picking a unique
 first and last name - and not going beyond the 6 character limit."
- Toon Moene



Re: [patch] Re: graphics

2002-02-15 Thread Jean-Marc Lasgouttes

 Herbert == Herbert Voss [EMAIL PROTECTED] writes:

Herbert Andre Poenitz wrote: [...]

 [new lyx file, insert graphics (doesn't matter whether it exists,
 'latex size' to 'custom' and '55%', click ok, click right on the
 picture. boom.]
Herbert [..]


Herbert there is a bug in UpdateWidgetsFromLength with this ?% units.
Herbert But this can't be the reason for your crash.

Actually, it is the reason, because the crash occurs when xforms tries
to write an error message.

JMarc



Re: [patch] Re: graphics

2002-02-15 Thread Jean-Marc Lasgouttes

> "Herbert" == Herbert Voss <[EMAIL PROTECTED]> writes:

Herbert> Andre Poenitz wrote: [...]

>> [new lyx file, insert graphics (doesn't matter whether it exists,
>> 'latex size' to 'custom' and '55%', click ok, click right on the
>> picture. boom.]
Herbert> [..]


Herbert> there is a bug in UpdateWidgetsFromLength with this ?% units.
Herbert> But this can't be the reason for your crash.

Actually, it is the reason, because the crash occurs when xforms tries
to write an error message.

JMarc



Re: [patch] Re: graphics

2002-02-14 Thread Angus Leeming

On Thursday 14 February 2002 5:21 pm, Herbert Voss wrote:
 Andre Poenitz wrote:
 [...]
 
  [new lyx file, insert graphics (doesn't matter whether it exists, 'latex
  size' to 'custom' and '55%',  click ok, click right on the picture. boom.]
 [..]
 
 
 there is a bug in UpdateWidgetsFromLength with this ?% units.
 But this can't be the reason for your crash.
 
 Herbert

Also applied.
A



Re: [patch] Re: graphics

2002-02-14 Thread Angus Leeming

On Thursday 14 February 2002 5:21 pm, Herbert Voss wrote:
> Andre Poenitz wrote:
> [...]
> 
> > [new lyx file, insert graphics (doesn't matter whether it exists, 'latex
> > size' to 'custom' and '55%',  click ok, click right on the picture. boom.]
> [..]
> 
> 
> there is a bug in UpdateWidgetsFromLength with this ?% units.
> But this can't be the reason for your crash.
> 
> Herbert

Also applied.
A