Re: LyX 2.4.0 (IM policy.xml ban on eps/pdf conversions)

2022-05-04 Thread José Abílio Matos
On Wednesday, 4 May 2022 12.48.10 WEST Pavel Sanda wrote:
> > 
> > ping :)
> 
> ping :)
> 
> > p

Riki is not the only person busy. :-D
After the next week things will calm down a bit and I will look into that.

-- 
José Abílio-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: LyX 2.4.0 (IM policy.xml ban on eps/pdf conversions)

2022-05-04 Thread Pavel Sanda
On Mon, Mar 07, 2022 at 06:13:10PM +0100, Pavel Sanda wrote:
> On Fri, Feb 04, 2022 at 10:36:57AM +, José Abílio Matos wrote:
> > On Wednesday, 2 February 2022 21.45.40 WET Pavel Sanda wrote:
> > > Jose, could I ask for pythonic help?
> > > We would need a routine in configure.py which check whether to remove 
> > > eps->png
> > > conversion in case IM bans those conversions. That could be done this way 
> > > by
> > > checking return status of the conversion. In bash that would be something
> > > like this:
> > > 
> > > echo '%!PS' > /tmp/.lyx_configure_test.eps
> > > convert  /tmp/.lyx_configure_test.eps /tmp/.lyx_configure_test.png
> > > if ! [ $? == 0 ] ; then
> > >   # remove eps->png conversion from configure settings, i.e. set 
> > > \converter
> > > "eps" "png" "" "" fi
> > > 
> > > 
> > > Completely different way would be mimicking what IM internally does with 
> > > GS
> > > when converting eps->png. I already checked little bit and unfortunately 
> > > it
> > > won't be oneliner if we want to get resolution right. But probably doable
> > > with additional script of our own. Pavel
> > 
> > I will look into this in the weekend.
> > 
> > 
> > At some point I will want to overhaul the configure.py script.
> > The purpose is, among others, to simplify the code required to do this kind 
> > of tests.
> > 
> > The test above is relatively easy to do.
> > Something that I should, probably, take into account is the order of the 
> > tests.
> > 
> > In the sense that if we different \convert lines we probably retain the 
> > last...
> > 
> 
> ping :)

ping :)

> p
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: LyX 2.4.0 (IM policy.xml ban on eps/pdf conversions)

2022-03-07 Thread Pavel Sanda
On Fri, Feb 04, 2022 at 10:36:57AM +, José Abílio Matos wrote:
> On Wednesday, 2 February 2022 21.45.40 WET Pavel Sanda wrote:
> > Jose, could I ask for pythonic help?
> > We would need a routine in configure.py which check whether to remove 
> > eps->png
> > conversion in case IM bans those conversions. That could be done this way by
> > checking return status of the conversion. In bash that would be something
> > like this:
> > 
> > echo '%!PS' > /tmp/.lyx_configure_test.eps
> > convert  /tmp/.lyx_configure_test.eps /tmp/.lyx_configure_test.png
> > if ! [ $? == 0 ] ; then
> >   # remove eps->png conversion from configure settings, i.e. set \converter
> > "eps" "png" "" "" fi
> > 
> > 
> > Completely different way would be mimicking what IM internally does with GS
> > when converting eps->png. I already checked little bit and unfortunately it
> > won't be oneliner if we want to get resolution right. But probably doable
> > with additional script of our own. Pavel
> 
> I will look into this in the weekend.
> 
> 
> At some point I will want to overhaul the configure.py script.
> The purpose is, among others, to simplify the code required to do this kind 
> of tests.
> 
> The test above is relatively easy to do.
> Something that I should, probably, take into account is the order of the 
> tests.
> 
> In the sense that if we different \convert lines we probably retain the 
> last...
> 

ping :)
p
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: LyX 2.4.0 (IM policy.xml ban on eps/pdf conversions)

2022-02-04 Thread José Abílio Matos
On Wednesday, 2 February 2022 21.45.40 WET Pavel Sanda wrote:
> Jose, could I ask for pythonic help?
> We would need a routine in configure.py which check whether to remove eps->png
> conversion in case IM bans those conversions. That could be done this way by
> checking return status of the conversion. In bash that would be something
> like this:
> 
> echo '%!PS' > /tmp/.lyx_configure_test.eps
> convert  /tmp/.lyx_configure_test.eps /tmp/.lyx_configure_test.png
> if ! [ $? == 0 ] ; then
>   # remove eps->png conversion from configure settings, i.e. set \converter
> "eps" "png" "" "" fi
> 
> 
> Completely different way would be mimicking what IM internally does with GS
> when converting eps->png. I already checked little bit and unfortunately it
> won't be oneliner if we want to get resolution right. But probably doable
> with additional script of our own. Pavel

I will look into this in the weekend.


At some point I will want to overhaul the configure.py script.
The purpose is, among others, to simplify the code required to do this kind of 
tests.

The test above is relatively easy to do.
Something that I should, probably, take into account is the order of the tests.

In the sense that if we different \convert lines we probably retain the last...


-- 
José Abílio


-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: LyX 2.4.0 (IM policy.xml ban on eps/pdf conversions)

2022-02-02 Thread Pavel Sanda
On Mon, Jan 24, 2022 at 11:32:42PM +0100, Pavel Sanda wrote:
> On Thu, Dec 02, 2021 at 10:24:58PM +0100, Pavel Sanda wrote:
> > - improve detection/users warning for banned eps->* conversion of 
> > imagemagick (high priority before final release, but not for next 
> > alpha/beta etc)
> 
> One option to automatically overcome the issue is to disable eps->png 
> conversion and allow pdf->png so that lyx performs eps->pdf->png.
> On my debian adding this to preferences sort of fixes the issue:
> 
> \converter "pdf6" "png" "pdftoppm -png -singlefile $$i >  $$o" ""
> \converter "eps" "png" "" ""
> 
> Problems I see:
> - the zoom factors in lyx window are not consistent with previous IM 
> conversion (you need to remove cache to test this)

I found out that IM uses by default DPI of 72 when calling GS so this problem 
is solved by using "pdftoppm -r 72 -png -singlefile $$i >  $$o"
Transparency is lost but I don't think that is a big deal.

> - not sure how is the pdftoppm conversion portable to windows/mac environment

Actually we have GS under our control for Win, not sure about Mac but mayb the 
IM policy is not to ban eps/pdf conversions.

> We could perhaps check policy.xml of IM and add those only in case eps/pdf is 
> banned when doing reconfigure.

Jose, could I ask for pythonic help?
We would need a routine in configure.py which check whether to remove eps->png 
conversion in case IM bans those conversions.
That could be done this way by checking return status of the conversion. In 
bash that would be something like this:

echo '%!PS' > /tmp/.lyx_configure_test.eps
convert  /tmp/.lyx_configure_test.eps /tmp/.lyx_configure_test.png
if ! [ $? == 0 ] ; then 
  # remove eps->png conversion from configure settings, i.e. set \converter 
"eps" "png" "" ""
fi


Completely different way would be mimicking what IM internally does with GS 
when converting eps->png. I already checked little bit and unfortunately it 
won't be oneliner if we want to get resolution right. But probably doable with 
additional script of our own.
Pavel
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: LyX 2.4.0 (IM policy.xml ban on eps/pdf conversions)

2022-01-24 Thread Pavel Sanda
On Thu, Dec 02, 2021 at 10:24:58PM +0100, Pavel Sanda wrote:
> - improve detection/users warning for banned eps->* conversion of imagemagick 
> (high priority before final release, but not for next alpha/beta etc)

One option to automatically overcome the issue is to disable eps->png 
conversion and allow pdf->png so that lyx performs eps->pdf->png.
On my debian adding this to preferences sort of fixes the issue:

\converter "pdf6" "png" "pdftoppm -png -singlefile $$i >  $$o" ""
\converter "eps" "png" "" ""

Problems I see:
- the zoom factors in lyx window are not consistent with previous IM conversion 
(you need to remove cache to test this)
- not sure how is the pdftoppm conversion portable to windows/mac environment


We could perhaps check policy.xml of IM and add those only in case eps/pdf is 
banned when doing reconfigure.

Pavel
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel