On Nov 15, 2012, at 7:18 AM, Scott Kostyshak wrote:

> On Wed, Nov 14, 2012 at 10:25 PM, Stephen Buonopane
> <sbuon...@bucknell.edu> wrote:
>> I am trying to debug a problem with the use of the "clip to bounding box" 
>> feature on pdf files.
>> LyX seems to extract a different value of the bounding box then the media 
>> box that is defined in the pdf file.
>> 
>> For example…
>> Media Box = 0 0 612 792
>> LyX gets 0 0 481 628
>> 
>> If you then try to clip to some smaller value, the on screen lyx preview and 
>> the pdf output do not match (they show different parts of the image) making 
>> it impossible to crop correctly with just the lyx screen alone.
>> 
>> My understanding is that on screen preview uses png files?
>> What code does LyX use to do the file conversion?
>> 
>> I checked the debug graphics output and I see a series of strings like
>> "/var/folders/t7/5jlv9y4m8xlf0r0059bn09v80000gn/T/lyx_tmpdir.L59595/gconvert0.M59595.pdf"
>> which goes from pdf -> ps -> eps ->png
>> 
>> I wanted to take a look at the actual png file that lyx is using for on 
>> screen display, but the above file does not seem to exist on my computer…I 
>> have things like
>> "…t7/5jlv9y4m8xlf0r0059bn09v80000gn/T/lyx_tmpdir.L59595/lyx_tmpbuf1"
>> 
>> My instinct is it might have something to do with an assumption of 72dpi vs 
>> 92dpi, since the ratio of the media boxes 481/612 is about the same as 
>> 72/92. And some googling suggested that png files make some assumption about 
>> dpi.
>> 
>> I am using Mac OSX 10.7.5 and LyX 2.0.4. This is a new problem that has 
>> cropped up since I switched to 10.7 and LyX2.0.4. (But I did both at the 
>> same time, so not sure what the root cause is)
>> 
>> If anyone wants to give it a try, attached is the file. Try changing from 
>> y=0 to y=300 for example.
>> It was generated with Print to PDF from excel, but I get the same problem 
>> from other sources as well (but it seems not from all pdf files).
> 
> This works fine for me on Ubuntu (meaning my pdf output is the same as
> my LyX output). Attached is the .lyx file.
> 
> If you want more output to analyze, use '-dbg graphics'. From what I
> understand, converted graphics are usually stored in your
> user-dir/cache folder, but I'm not sure if LyX uses a converter in
> this situation. I think Qt handles the pdf directly.
> 
> Scott

Thanks, Scott

As I suspected this may be a Mac specific issue.

Can any Mac developers tell me  how LyX (or Qt?) displays the onscreen graphics 
and where the files are stored. 
In /var/lyx_tmpdir.####/lyx_tmpbuf#/* I see other temporary files like the 
actual latex code and even math preview png graphics, but for inserted graphics 
I see only the original pdf file.
So maybe Qt is doing the cropping independent of Lyx?

In any case, somehow LyX is getting the wrong bounding box from an external 
converter. 
Is it just ImageMagick convert doing the conversion?

Steve


Reply via email to