Re: Pasting graphics in LyX 2.1 beta on Mac

2013-09-05 Thread Georg Baum
Anders Ekberg wrote:

 Thanks Patrick
 I think you are on to the reason (see my previous post sent just as I got
 your reply). But I don't see how to save as a pdf. In the beta1 the only
 options are png and jpeg and both give 72 dpi resolutions (setting the
 suffix as pdf results in a file that Preview can't open, but that works
 with low res in LyX; probably a png).

Patricks finding looks very reasonable to me as well. If PDF is not offered 
for pasting this means that LyX dos not see any PDF on the clipboard. If you 
call LyX with

lyx -dbg action

in a terminal and look for Found format you should see whether it finds 
PDF or not. If that does not give any new insight you'd need to run LyX in a 
debugger. The place to look at would be GuiClipboard::hasGraphicsContents().


Georg



Re: Pasting graphics in LyX 2.1 beta on Mac

2013-09-05 Thread Anders Ekberg
On 2013-09-05 22:06, Georg Baum georg.b...@post.rwth-aachen.de wrote:

Anders Ekberg wrote:

 Thanks Patrick
 I think you are on to the reason (see my previous post sent just as I
got
 your reply). But I don't see how to save as a pdf. In the beta1 the only
 options are png and jpeg and both give 72 dpi resolutions (setting the
 suffix as pdf results in a file that Preview can't open, but that works
 with low res in LyX; probably a png).

Patricks finding looks very reasonable to me as well. If PDF is not
offered 
for pasting this means that LyX dos not see any PDF on the clipboard. If
you 
call LyX with

lyx -dbg action

in a terminal and look for Found format you should see whether it finds
PDF or not. If that does not give any new insight you'd need to run LyX
in a 
debugger. The place to look at would be
GuiClipboard::hasGraphicsContents().

Seems like LyX indeed finds both formats:

frontends/qt4/GuiClipboard.cpp (493): We found 2 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/pdf
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiClipboard.cpp (493): We found 2 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/pdf
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiClipboard.cpp (493): We found 2 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/pdf
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiClipboard.cpp (493): We found 2 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/pdf
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiClipboard.cpp (493): We found 2 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/pdf
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiApplication.cpp (1263): dispatch msg is Klistra

The pasting in itself does not work when LyX is opened in this way (no
dialogue to save the picture that is pasted is offered).

And I just noticed something interesting:
If I open LyX, go to Preview, copy the image, and then paste there is
indeed a pdf option which gives a high resolution (and for me a low-res
preview).

If I then close LyX, reopens it and pastes the clip (that is still in
memory), there is only the png and jpeg options to paste, and the output
is:
Text3.cpp (470): Text::dispatch: cmd:  action: 13 [paste]  arg: '' x: 0 y:
0
frontends/qt4/GuiClipboard.cpp (493): We found 1 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiClipboard.cpp (493): We found 1 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiClipboard.cpp (493): We found 1 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiClipboard.cpp (493): We found 1 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiClipboard.cpp (493): We found 1 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiApplication.cpp (1263): dispatch msg is Klistra

Perhaps this has to do with that I get a SIGSEGV-error when quitting:

lyx(1713,0x7fff76590180) malloc: *** error for object 0x102076338: pointer
being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6


So, in conclusion, with LyX 2.1 the issue is indeed solved if the image is
copied after LyX is opened and the pasted image is saved as a pdf.

Many thanks!

/Anders

 





Re: Pasting graphics in LyX 2.1 beta on Mac

2013-09-05 Thread Georg Baum
Anders Ekberg wrote:

 Thanks Patrick
 I think you are on to the reason (see my previous post sent just as I got
 your reply). But I don't see how to save as a pdf. In the beta1 the only
 options are png and jpeg and both give 72 dpi resolutions (setting the
 suffix as pdf results in a file that Preview can't open, but that works
 with low res in LyX; probably a png).

Patricks finding looks very reasonable to me as well. If PDF is not offered 
for pasting this means that LyX dos not see any PDF on the clipboard. If you 
call LyX with

lyx -dbg action

in a terminal and look for Found format you should see whether it finds 
PDF or not. If that does not give any new insight you'd need to run LyX in a 
debugger. The place to look at would be GuiClipboard::hasGraphicsContents().


Georg



Re: Pasting graphics in LyX 2.1 beta on Mac

2013-09-05 Thread Anders Ekberg
On 2013-09-05 22:06, Georg Baum georg.b...@post.rwth-aachen.de wrote:

Anders Ekberg wrote:

 Thanks Patrick
 I think you are on to the reason (see my previous post sent just as I
got
 your reply). But I don't see how to save as a pdf. In the beta1 the only
 options are png and jpeg and both give 72 dpi resolutions (setting the
 suffix as pdf results in a file that Preview can't open, but that works
 with low res in LyX; probably a png).

Patricks finding looks very reasonable to me as well. If PDF is not
offered 
for pasting this means that LyX dos not see any PDF on the clipboard. If
you 
call LyX with

lyx -dbg action

in a terminal and look for Found format you should see whether it finds
PDF or not. If that does not give any new insight you'd need to run LyX
in a 
debugger. The place to look at would be
GuiClipboard::hasGraphicsContents().

Seems like LyX indeed finds both formats:

frontends/qt4/GuiClipboard.cpp (493): We found 2 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/pdf
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiClipboard.cpp (493): We found 2 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/pdf
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiClipboard.cpp (493): We found 2 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/pdf
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiClipboard.cpp (493): We found 2 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/pdf
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiClipboard.cpp (493): We found 2 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/pdf
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiApplication.cpp (1263): dispatch msg is Klistra

The pasting in itself does not work when LyX is opened in this way (no
dialogue to save the picture that is pasted is offered).

And I just noticed something interesting:
If I open LyX, go to Preview, copy the image, and then paste there is
indeed a pdf option which gives a high resolution (and for me a low-res
preview).

If I then close LyX, reopens it and pastes the clip (that is still in
memory), there is only the png and jpeg options to paste, and the output
is:
Text3.cpp (470): Text::dispatch: cmd:  action: 13 [paste]  arg: '' x: 0 y:
0
frontends/qt4/GuiClipboard.cpp (493): We found 1 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiClipboard.cpp (493): We found 1 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiClipboard.cpp (493): We found 1 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiClipboard.cpp (493): We found 1 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiClipboard.cpp (493): We found 1 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiApplication.cpp (1263): dispatch msg is Klistra

Perhaps this has to do with that I get a SIGSEGV-error when quitting:

lyx(1713,0x7fff76590180) malloc: *** error for object 0x102076338: pointer
being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6


So, in conclusion, with LyX 2.1 the issue is indeed solved if the image is
copied after LyX is opened and the pasted image is saved as a pdf.

Many thanks!

/Anders

 





Re: Pasting graphics in LyX 2.1 beta on Mac

2013-09-05 Thread Georg Baum
Anders Ekberg wrote:

> Thanks Patrick
> I think you are on to the reason (see my previous post sent just as I got
> your reply). But I don't see how to save as a pdf. In the beta1 the only
> options are png and jpeg and both give 72 dpi resolutions (setting the
> suffix as pdf results in a file that Preview can't open, but that works
> with low res in LyX; probably a png).

Patricks finding looks very reasonable to me as well. If PDF is not offered 
for pasting this means that LyX dos not see any PDF on the clipboard. If you 
call LyX with

lyx -dbg action

in a terminal and look for "Found format" you should see whether it finds 
PDF or not. If that does not give any new insight you'd need to run LyX in a 
debugger. The place to look at would be GuiClipboard::hasGraphicsContents().


Georg



Re: Pasting graphics in LyX 2.1 beta on Mac

2013-09-05 Thread Anders Ekberg
On 2013-09-05 22:06, "Georg Baum"  wrote:

>Anders Ekberg wrote:
>
>> Thanks Patrick
>> I think you are on to the reason (see my previous post sent just as I
>>got
>> your reply). But I don't see how to save as a pdf. In the beta1 the only
>> options are png and jpeg and both give 72 dpi resolutions (setting the
>> suffix as pdf results in a file that Preview can't open, but that works
>> with low res in LyX; probably a png).
>
>Patricks finding looks very reasonable to me as well. If PDF is not
>offered 
>for pasting this means that LyX dos not see any PDF on the clipboard. If
>you 
>call LyX with
>
>lyx -dbg action
>
>in a terminal and look for "Found format" you should see whether it finds
>PDF or not. If that does not give any new insight you'd need to run LyX
>in a 
>debugger. The place to look at would be
>GuiClipboard::hasGraphicsContents().

Seems like LyX indeed finds both formats:

frontends/qt4/GuiClipboard.cpp (493): We found 2 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/pdf
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiClipboard.cpp (493): We found 2 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/pdf
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiClipboard.cpp (493): We found 2 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/pdf
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiClipboard.cpp (493): We found 2 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/pdf
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiClipboard.cpp (493): We found 2 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/pdf
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiApplication.cpp (1263): dispatch msg is Klistra

The pasting in itself does not work when LyX is opened in this way (no
dialogue to save the picture that is pasted is offered).

And I just noticed something interesting:
If I open LyX, go to Preview, copy the image, and then paste there is
indeed a pdf option which gives a high resolution (and for me a low-res
preview).

If I then close LyX, reopens it and pastes the clip (that is still in
memory), there is only the png and jpeg options to paste, and the output
is:
Text3.cpp (470): Text::dispatch: cmd:  action: 13 [paste]  arg: '' x: 0 y:
0
frontends/qt4/GuiClipboard.cpp (493): We found 1 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiClipboard.cpp (493): We found 1 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiClipboard.cpp (493): We found 1 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiClipboard.cpp (493): We found 1 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiClipboard.cpp (493): We found 1 formats
frontends/qt4/GuiClipboard.cpp (495): Found format application/x-qt-image
frontends/qt4/GuiApplication.cpp (1263): dispatch msg is Klistra

Perhaps this has to do with that I get a SIGSEGV-error when quitting:

lyx(1713,0x7fff76590180) malloc: *** error for object 0x102076338: pointer
being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6


So, in conclusion, with LyX 2.1 the issue is indeed solved if the image is
copied after LyX is opened and the pasted image is saved as a pdf.

Many thanks!

/Anders

 





Re: Pasting graphics in LyX 2.1 beta on Mac

2013-09-04 Thread Anders Ekberg
 
 Anders Ekberg wrote:
  Š The picture is scanned to pdf with 300 dpi
  resolution. When cropping and saving in Preview to a png with 300 dpi and
  then inserting this picture in LyX (with insert graphic) the output is
  fine (i.e. with a resolution of 300 dpi which is sufficient for my
  purposes). On the other hand when I copy in Preview and then paste in 
LyX,
  the resolution becomes low (I would guess about 150 dpi, which is
  incidentally the default resolution when saving png:s in Preview, so the
  problem well may be on the copying and not the pasting side).
  
  So, in short, my question is: Which resolution does LyX use to save
  graphics (on Mac) and is there a way to change it?
  
  LyX does not scale the graphics. It uses whatever is on the clipboard, but
  maybe there is some scaling happening in qt. Did you try to paste the
  graphics in a different application, e.g. gimp? If that does not preserve
  the resolution the problem is with copying the graphics to the clipboard.
  Otherwise it is in LyX or qt, and one would need to debug.
 
 Good suggestion Georg.
 Attached are pdfs from LyX and from Word. Same clipping from Preview. The
 resolution in the LyX-produced file is much less. So something happens when
 LyX pastes the clip and I save it as a png in that process. I would consider
 this a bug (if LyX or qt is another issueŠ).
 
  I also tried on Windows (copying from Acrobat Reader) and there the
  resolution was good, but the dimensions distorted (compressed in height).
 
  Strange. Does the distortion come from different x/y scaling factors in
 LyX, 
  or is it also visible in the created .png file?
 
  Georg

Update:
The windows skewness seems to be related to that file. Tried a new one now
and it works. (Could have be due to the fact that the only selection I can
find in Windows reader on Windows is select all, so the entire [one page]
file was copied).

The image pasted from LyX is 72 dpi. I suspect that the copying and saving
via LyX somehow mixes up the file resolution and the resolution on the
screen. Can't really be the fault of Preview since it works in Word, so
should be a qt or LyX bug.




Re: Pasting graphics in LyX 2.1 beta on Mac

2013-09-04 Thread Anders Ekberg
 
 Anders Ekberg wrote:
  Š The picture is scanned to pdf with 300 dpi
  resolution. When cropping and saving in Preview to a png with 300 dpi and
  then inserting this picture in LyX (with insert graphic) the output is
  fine (i.e. with a resolution of 300 dpi which is sufficient for my
  purposes). On the other hand when I copy in Preview and then paste in 
LyX,
  the resolution becomes low (I would guess about 150 dpi, which is
  incidentally the default resolution when saving png:s in Preview, so the
  problem well may be on the copying and not the pasting side).
  
  So, in short, my question is: Which resolution does LyX use to save
  graphics (on Mac) and is there a way to change it?
  
  LyX does not scale the graphics. It uses whatever is on the clipboard, but
  maybe there is some scaling happening in qt. Did you try to paste the
  graphics in a different application, e.g. gimp? If that does not preserve
  the resolution the problem is with copying the graphics to the clipboard.
  Otherwise it is in LyX or qt, and one would need to debug.
 
 Good suggestion Georg.
 Attached are pdfs from LyX and from Word. Same clipping from Preview. The
 resolution in the LyX-produced file is much less. So something happens when
 LyX pastes the clip and I save it as a png in that process. I would consider
 this a bug (if LyX or qt is another issueŠ).
 
  I also tried on Windows (copying from Acrobat Reader) and there the
  resolution was good, but the dimensions distorted (compressed in height).
 
  Strange. Does the distortion come from different x/y scaling factors in
 LyX, 
  or is it also visible in the created .png file?
 
  Georg

Update:
The windows skewness seems to be related to that file. Tried a new one now
and it works. (Could have be due to the fact that the only selection I can
find in Windows reader on Windows is select all, so the entire [one page]
file was copied).

The image pasted from LyX is 72 dpi. I suspect that the copying and saving
via LyX somehow mixes up the file resolution and the resolution on the
screen. Can't really be the fault of Preview since it works in Word, so
should be a qt or LyX bug.




Re: Pasting graphics in LyX 2.1 beta on Mac

2013-09-04 Thread Anders Ekberg
> 
> Anders Ekberg wrote:
>>> >> Š The picture is scanned to pdf with 300 dpi
>>> >> resolution. When cropping and saving in Preview to a png with 300 dpi and
>>> >> then inserting this picture in LyX (with insert graphic) the output is
>>> >> fine (i.e. with a resolution of 300 dpi which is sufficient for my
>>> >> purposes). On the other hand when I copy in Preview and then paste in >>>
LyX,
>>> >> the resolution becomes low (I would guess about 150 dpi, which is
>>> >> incidentally the default resolution when saving png:s in Preview, so the
>>> >> problem well may be on the copying and not the pasting side).
>>> >> 
>>> >> So, in short, my question is: Which resolution does LyX use to save
>>> >> graphics (on Mac) and is there a way to change it?
>> > 
>> > LyX does not scale the graphics. It uses whatever is on the clipboard, but
>> > maybe there is some scaling happening in qt. Did you try to paste the
>> > graphics in a different application, e.g. gimp? If that does not preserve
>> > the resolution the problem is with copying the graphics to the clipboard.
>> > Otherwise it is in LyX or qt, and one would need to debug.
> 
> Good suggestion Georg.
> Attached are pdfs from LyX and from Word. Same clipping from Preview. The
> resolution in the LyX-produced file is much less. So something happens when
> LyX pastes the clip and I save it as a png in that process. I would consider
> this a bug (if LyX or qt is another issueŠ).
> 
>>> >> I also tried on Windows (copying from Acrobat Reader) and there the
>>> >> resolution was good, but the dimensions distorted (compressed in height).
>> >
>> > Strange. Does the distortion come from different x/y scaling factors in
>> LyX, 
>> > or is it also visible in the created .png file?
>> >
>> > Georg

Update:
The windows skewness seems to be related to that file. Tried a new one now
and it works. (Could have be due to the fact that the only selection I can
find in Windows reader on Windows is select all, so the entire [one page]
file was copied).

The image pasted from LyX is 72 dpi. I suspect that the copying and saving
via LyX somehow mixes up the file resolution and the resolution on the
screen. Can't really be the fault of Preview since it works in Word, so
should be a qt or LyX bug.




Re: Pasting graphics in LyX 2.1 beta on Mac

2013-09-03 Thread Georg Baum
Anders Ekberg wrote:

 I noticed when I had to paste some graphics with a lot of text that LyX 
 (or
 rather the libraries used by LyX) seem to reduce the resolution of the 
 pasted
 graphics (copied selection from Preview and pasted as a png-file in 
 LyX). Anyone else experienced it, or could it be a setting somewhere in
 my environment? If so, does anyone have an idea of how to solve it (save
 the cropped file as a png in Preview of course works, but is several
 additional steps).
 
 All the best!
 Anders
 The best you can do in these cases is save the graphic in svg format
 whenever posible. Otherwise you must edit your graphic on inkscape to add
 the text manually and then export it as svg. If you doesn´t go into
 vectorial graphics you will definetively lose resolution and then the text
 will look awful.

While I would always prefer svg over png if the source is a vector graphic, 
this does not help for bitmaps as the one Anders is trying to paste.

 Thanks Alex,
 I probably wasn't clear enough: The picture is scanned to pdf with 300 dpi
 resolution. When cropping and saving in Preview to a png with 300 dpi and
 then inserting this picture in LyX (with insert graphic) the output is
 fine (i.e. with a resolution of 300 dpi which is sufficient for my
 purposes). On the other hand when I copy in Preview and then paste in LyX,
 the resolution becomes low (I would guess about 150 dpi, which is
 incidentally the default resolution when saving png:s in Preview, so the
 problem well may be on the copying and not the pasting side).
 
 So, in short, my question is: Which resolution does LyX use to save
 graphics (on Mac) and is there a way to change it?

LyX does not scale the graphics. It uses whatever is on the clipboard, but 
maybe there is some scaling happening in qt. Did you try to paste the 
graphics in a different application, e.g. gimp? If that does not preserve 
the resolution the problem is with copying the graphics to the clipboard. 
Otherwise it is in LyX or qt, and one would need to debug.

 I also tried on Windows (copying from Acrobat Reader) and there the
 resolution was good, but the dimensions distorted (compressed in height).

Strange. Does the distortion come from different x/y scaling factors in LyX, 
or is it also visible in the created .png file?


Georg




Re: Pasting graphics in LyX 2.1 beta on Mac

2013-09-03 Thread Georg Baum
Anders Ekberg wrote:

 I noticed when I had to paste some graphics with a lot of text that LyX 
 (or
 rather the libraries used by LyX) seem to reduce the resolution of the 
 pasted
 graphics (copied selection from Preview and pasted as a png-file in 
 LyX). Anyone else experienced it, or could it be a setting somewhere in
 my environment? If so, does anyone have an idea of how to solve it (save
 the cropped file as a png in Preview of course works, but is several
 additional steps).
 
 All the best!
 Anders
 The best you can do in these cases is save the graphic in svg format
 whenever posible. Otherwise you must edit your graphic on inkscape to add
 the text manually and then export it as svg. If you doesn´t go into
 vectorial graphics you will definetively lose resolution and then the text
 will look awful.

While I would always prefer svg over png if the source is a vector graphic, 
this does not help for bitmaps as the one Anders is trying to paste.

 Thanks Alex,
 I probably wasn't clear enough: The picture is scanned to pdf with 300 dpi
 resolution. When cropping and saving in Preview to a png with 300 dpi and
 then inserting this picture in LyX (with insert graphic) the output is
 fine (i.e. with a resolution of 300 dpi which is sufficient for my
 purposes). On the other hand when I copy in Preview and then paste in LyX,
 the resolution becomes low (I would guess about 150 dpi, which is
 incidentally the default resolution when saving png:s in Preview, so the
 problem well may be on the copying and not the pasting side).
 
 So, in short, my question is: Which resolution does LyX use to save
 graphics (on Mac) and is there a way to change it?

LyX does not scale the graphics. It uses whatever is on the clipboard, but 
maybe there is some scaling happening in qt. Did you try to paste the 
graphics in a different application, e.g. gimp? If that does not preserve 
the resolution the problem is with copying the graphics to the clipboard. 
Otherwise it is in LyX or qt, and one would need to debug.

 I also tried on Windows (copying from Acrobat Reader) and there the
 resolution was good, but the dimensions distorted (compressed in height).

Strange. Does the distortion come from different x/y scaling factors in LyX, 
or is it also visible in the created .png file?


Georg




Re: Pasting graphics in LyX 2.1 beta on Mac

2013-09-03 Thread Georg Baum
Anders Ekberg wrote:

>> I noticed when I had to paste some graphics with a lot of text that LyX 
>> (or
>> rather the libraries used by LyX) seem to reduce the resolution of the 
>> pasted
>> graphics (copied selection from Preview and pasted as a png-file in 
>> LyX). Anyone else experienced it, or could it be a setting somewhere in
>> my environment? If so, does anyone have an idea of how to solve it (save
>> the cropped file as a png in Preview of course works, but is several
>> additional steps).
>> 
>> All the best!
>> Anders
> The best you can do in these cases is save the graphic in svg format
> whenever posible. Otherwise you must edit your graphic on inkscape to add
> the text manually and then export it as svg. If you doesn´t go into
> vectorial graphics you will definetively lose resolution and then the text
> will look awful.

While I would always prefer svg over png if the source is a vector graphic, 
this does not help for bitmaps as the one Anders is trying to paste.

> Thanks Alex,
> I probably wasn't clear enough: The picture is scanned to pdf with 300 dpi
> resolution. When cropping and saving in Preview to a png with 300 dpi and
> then inserting this picture in LyX (with insert graphic) the output is
> fine (i.e. with a resolution of 300 dpi which is sufficient for my
> purposes). On the other hand when I copy in Preview and then paste in LyX,
> the resolution becomes low (I would guess about 150 dpi, which is
> incidentally the default resolution when saving png:s in Preview, so the
> problem well may be on the copying and not the pasting side).
> 
> So, in short, my question is: Which resolution does LyX use to save
> graphics (on Mac) and is there a way to change it?

LyX does not scale the graphics. It uses whatever is on the clipboard, but 
maybe there is some scaling happening in qt. Did you try to paste the 
graphics in a different application, e.g. gimp? If that does not preserve 
the resolution the problem is with copying the graphics to the clipboard. 
Otherwise it is in LyX or qt, and one would need to debug.

> I also tried on Windows (copying from Acrobat Reader) and there the
> resolution was good, but the dimensions distorted (compressed in height).

Strange. Does the distortion come from different x/y scaling factors in LyX, 
or is it also visible in the created .png file?


Georg




Re: Pasting graphics in LyX 2.1 beta on Mac

2013-09-02 Thread Alex Vergara Gil

  - Original Message - 

  I noticed when I had to paste some graphics with a lot of text that LyX (or 
rather the libraries used by LyX) seem to reduce the resolution of the pasted 
graphics (copied selection from Preview and pasted as a png-file in LyX). 
Anyone else experienced it, or could it be a setting somewhere in my 
environment? If so, does anyone have an idea of how to solve it (save the 
cropped file as a png in Preview of course works, but is several additional 
steps).

  All the best!
  Anders

The best you can do in these cases is save the graphic in svg format whenever 
posible. Otherwise you must edit your graphic on inkscape to add the text 
manually and then export it as svg. If you doesn´t go into vectorial graphics 
you will definetively lose resolution and then the text will look awful.

regards!
Alex





Re: Pasting graphics in LyX 2.1 beta on Mac

2013-09-02 Thread Alex Vergara Gil

  - Original Message - 

  I noticed when I had to paste some graphics with a lot of text that LyX (or 
rather the libraries used by LyX) seem to reduce the resolution of the pasted 
graphics (copied selection from Preview and pasted as a png-file in LyX). 
Anyone else experienced it, or could it be a setting somewhere in my 
environment? If so, does anyone have an idea of how to solve it (save the 
cropped file as a png in Preview of course works, but is several additional 
steps).

  All the best!
  Anders

The best you can do in these cases is save the graphic in svg format whenever 
posible. Otherwise you must edit your graphic on inkscape to add the text 
manually and then export it as svg. If you doesn´t go into vectorial graphics 
you will definetively lose resolution and then the text will look awful.

regards!
Alex





Re: Pasting graphics in LyX 2.1 beta on Mac

2013-09-02 Thread Alex Vergara Gil

  - Original Message - 

  I noticed when I had to paste some graphics with a lot of text that LyX (or 
rather the libraries used by LyX) seem to reduce the resolution of the pasted 
graphics (copied selection from Preview and pasted as a png-file in LyX). 
Anyone else experienced it, or could it be a setting somewhere in my 
environment? If so, does anyone have an idea of how to solve it (save the 
cropped file as a png in Preview of course works, but is several additional 
steps).

  All the best!
  Anders

The best you can do in these cases is save the graphic in svg format whenever 
posible. Otherwise you must edit your graphic on inkscape to add the text 
manually and then export it as svg. If you doesn´t go into vectorial graphics 
you will definetively lose resolution and then the text will look awful.

regards!
Alex