RWAP / PrinterToPDF

Project for converting captured printer data files to PDF format
GNU General Public License v3.0
85 stars 19 forks source link

Segmentation fault #12

Closed Mike-DE-RE closed 7 years ago

Mike-DE-RE commented 7 years ago

I've just downloaded and compiled the latest version of PrinterConvert.c:

gcc PrinterConvert.c -o PrinterConvert -lSDL -lpng -lrt -ggdb

/PrinterConvert 4 3 SIEMENS.C16 1 sdloff ./

delays around ack: t1=0 t2=0 t3=0 t4=0 t5=0 write = png/page7.png segmentation fault

Very interesting: I've cleared my ./png ./pdf folder and it still does not restart with page1.png

gdb PrinterConvert GNU gdb 6.8 Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i586-suse-linux"... (gdb) run ./PrinterConvert 4 3 SIEMENS.C16 1 sdloff ./ Starting program: /home/user/PrinterToPDF/PrinterConvert ./PrinterConvert 4 3 SIEMENS.C16 1 sdloff ./ [Thread debugging using libthread_db enabled]

delays around ack: t1=0 t2=0 t3=0 t4=0 t5=0 [New Thread 0xb7dba8d0 (LWP 6067)] write = sdloff/png/page1.png PNG error - Could not open file sdloff/png/page1.png for writing command = convert sdloff/png/page1.png sdloff/pdf/page1.pdf convert: unable to open image sdloff/png/page1.png': No such file or directory. convert: unable to open filesdloff/png/page1.png'. convert: missing an image filename sdloff/pdf/page1.pdf'. write = sdloff/png/page2.png PNG error - Could not open file sdloff/png/page2.png for writing command = convert sdloff/png/page2.png sdloff/pdf/page2.pdf convert: unable to open imagesdloff/png/page2.png': No such file or directory. convert: unable to open file sdloff/png/page2.png'. convert: missing an image filenamesdloff/pdf/page2.pdf'.

I am at page 3 write = sdloff/png/page3.png PNG error - Could not open file sdloff/png/page3.png for writing command = convert sdloff/png/page3.png sdloff/pdf/page3.pdf convert: unable to open image sdloff/png/page3.png': No such file or directory. convert: unable to open filesdloff/png/page3.png'. convert: missing an image filename `sdloff/pdf/page3.pdf'.

Program exited normally. (gdb)

Mike-DE-RE commented 7 years ago

Reloaded and compiled:

time ./PrinterConvert 4 3 SIEMENS.C16 1 sdloff ./

delays around ack: t1=0 t2=0 t3=0 t4=0 t5=0 write = png/page1.png command = convert png/page1.png ./pdf/page1.pdf convert: Too many IDAT's found png/page1.png'. convert: Corrupt imagepng/page1.png'. convert: missing an image filename ./pdf/page1.pdf'. write = png/page2.png command = convert png/page2.png ./pdf/page2.pdf convert: Too many IDAT's foundpng/page2.png'. convert: Corrupt image png/page2.png'. convert: missing an image filename./pdf/page2.pdf'.

I am at page 3 write = png/page3.png command = convert png/page3.png ./pdf/page3.pdf convert: Too many IDAT's found png/page3.png'. convert: Corrupt imagepng/page3.png'. convert: missing an image filename `./pdf/page3.pdf'.

real 1m22.631s user 1m2.476s sys 0m5.460s

RWAP commented 7 years ago

Try now - ImageMagick does not like the way libPNG adds the 10 lines at a time to the file, so I have incorporated some more speed improvements and reverted too writing 1 line at a time to the png file