internetarchive / epub

For code related to making ePub files
40 stars 3 forks source link

invalid epub for archive item with bad image sizes #18

Closed mikemccabe closed 13 years ago

mikemccabe commented 13 years ago

http://ia600108.us.archive.org/6/items/stanleyinafrica00boyduoft/

python convert_iabook.py --epub stanleyinafrica00boyduoft /6/items/stanleyinafrica00boyduoft pamcut: You have specified a bottom edge (3161) that is below the bottom edge of the image (3160) jpegtopnm: EOF / write error writing a row of pixels pnmscale: EOF / read error reading magic number pnmtojpeg: EOF / read error reading magic number pamcut: You have specified a bottom edge (3161) that is below the bottom edge of the image (3160) jpegtopnm: EOF / write error writing a row of pixels pnmscale: EOF / read error reading magic number pnmtojpeg: EOF / read error reading magic number pamcut: You have specified a bottom edge (3161) that is below the bottom edge of the image (3160) jpegtopnm: EOF / write error writing a row of pixels pnmscale: EOF / read error reading magic number pnmtojpeg: EOF / read error reading magic number pamcut: You have specified a right edge (1950) that is beyond the right edge of the image (1949) jpegtopnm: EOF / write error writing a row of pixels pnmscale: EOF / read error reading magic number pnmtojpeg: EOF / read error reading magic number

... this creates a useable epub, but one that fails epubcheck:

java -jar epubcheck-1.0.3.jar stanleyin* Epubcheck Version 1.0.3

ERROR: stanleyinafrica00boyduoft.epub: image file OEBPS/images/picture233.jpg is too short ERROR: stanleyinafrica00boyduoft.epub: image file OEBPS/images/picture236.jpg is too short ERROR: stanleyinafrica00boyduoft.epub: image file OEBPS/images/picture239.jpg is too short ERROR: stanleyinafrica00boyduoft.epub: image file OEBPS/images/picture242.jpg is too short

Check finished with warnings or errors!

mikemccabe commented 13 years ago

fix checked in - add '-pad' to pamcut to ignore error. (not totally ideal, as it creates a black border rather than clipping.)