Thread: PRS-500 RasterFarian 2.5 Beta
View Single Post
Old 04-18-2007, 03:22 PM   #12
ashkulz
Addict
ashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enough
 
ashkulz's Avatar
 
Posts: 350
Karma: 705
Join Date: Dec 2006
Location: Mumbai, India
Device: Kindle 1/REB 1200
Quote:
Originally Posted by eskin
In a perfect world, it would be great if RasterFarian would use the crop information in the PDF file as the starting bounds rectangle for the auto-sizing functionality.
alex_d, I have stopped using bbox computation via Ghostscript in PDFRead because of this very reason. A much better approach is to simply convert a page to EPS, rasterize via Ghostscript using -dEPSCrop and then finally remove all pixels which have the background color. I do that via using PIL, you can achieve the same effect by using pnmcrop from NetPBM (which you use). It will do very nice cropping, even more better than GS (You might want to leave it as an option though, like I have with --gscrop).

And there's one more advantage: Ghostscript problems on blank pages go away with this approach.

BTW, I was inadvertently using the image enhancement step you added via pgmenhance; the same thing is used internally in rbmake (which is the finally step for my 1100), so I've added it as an option in PDFRead, too

Last edited by ashkulz; 04-18-2007 at 03:26 PM.
ashkulz is offline