albrechtf / mcf2pdf

"My CEWE Photobook" MCF to PDF converter
Other
40 stars 37 forks source link

Error message: File is not the correct format #12

Closed fschmid2 closed 3 years ago

fschmid2 commented 7 years ago

Thank you for your great tool! I have two CEWE-books of exactly the same format of which I'd like to have a .pdf copy. One finished without an error message (yet quite many fotos are rotated -90 degrees), but for the other I get the following message:

java.io.IOException: com.drew.imaging.ImageProcessingException: File is not the correct format at net.sf.mcf2pdf.mcfelements.util.ImageUtil.getImageRotation(ImageUtil.java:119) at net.sf.mcf2pdf.mcfelements.util.ImageUtil.readImage(ImageUtil.java:77) at net.sf.mcf2pdf.pagebuild.PageImage.renderAsBitmap(PageImage.java:82) at net.sf.mcf2pdf.pagebuild.PageImageBackground.renderAsBitmap(PageImageBackground.java:29) at net.sf.mcf2pdf.pagebuild.BitmapPageBuilder.addToDocumentBuilder(BitmapPageBuilder.java:77) at net.sf.mcf2pdf.Mcf2FoConverter.convert(Mcf2FoConverter.java:240) at net.sf.mcf2pdf.Main.main(Main.java:181)

Any help is appreciated.

albrechtf commented 7 years ago

This seems to be an issue when using (some sort of) PNG images in the photobook. A "forker" has solved this with this change in their fork: https://github.com/h4ssi/mcf2pdf/commit/6834871946d3e27d129ab87a534cb7a7a04677e5

I will review that change and maybe include it, as time permits, in the software. Unfortunately, this will not be done until christmas... Sorry for that! Workaround: Convert your PNG image(s) to JPEG format (Windows Paint could do the trick, if you have no special image processing tool) and replace them in your photo book.

fschmid2 commented 7 years ago

Thank you. What about the rotation issue I mentioned just briefly? On almost every page there are one or more images that are rotated 90 degrees (e.g. in landscape although they should be straight or vice-versa). Is there something I can do about that?

albrechtf commented 7 years ago

It may be related to this issue, as the same library causing the error message is also responsible for detecting image rotations. Did you rotate the images in CEWE, or were they rotated automatically by the software?

fschmid2 commented 7 years ago

No, I did not rotate the images in CEWE. There are rotated fotos in the pdf document that are landscape in the original file and in the foto book, others are landscape but I chose only a straight formatted part of it in the foto book.

dceb commented 7 years ago

About that bug solved by h4ssi, do you know when a new version of the program will be available, allowing to print .png files too? I try to change the code myself but i always have some error. Is there, by any cases, some manipulation to do after the code's modifications?

albrechtf commented 6 years ago

Please check if the issue is fixed with the latest 0.3.3 release: https://github.com/albrechtf/mcf2pdf/releases/tag/mcf2pdf-0.3.3 Thanks!