I have around 60 pages of a calculus book scanned, and I would like to add in the answers for each chapter’s questions after the last page for questions. When opening the original jpeg files I see the pixel dimensions are different, thus I use open up terminal and enter:
1) a@a-NC210-NC110:~/Desktop/Calc03Project$ sudo mogrify -resize 1200 -format jpg -quality 100% -verbose Calc03-05*.jpg
Calc03-050.jpg JPEG 2400x610 2400x610+0+0 8-bit DirectClass 381KB 0.080u 0:00.080
Calc03-050.jpg JPEG 2400x610=>1200x305 1200x305+0+0 8-bit DirectClass 156KB 1.080u 0:00.660
Calc03-051.jpg JPEG 2400x926 2400x926+0+0 8-bit DirectClass 608KB 0.140u 0:00.139
Calc03-051.jpg JPEG 2400x926=>1200x463 1200x463+0+0 8-bit DirectClass 246KB 1.670u 0:01.100
... (etc.)
When I reopen up the same jpg files with image viewer, it shows that all of them have the same pixel width. I then proceed to convert these files into separate pdf files with the following command (I have a netbook, so the convert command isn’t suitable):
2) a@a-NC210-NC110:~/Desktop/Calc03Project$ sudo mogrify -verbose -format pdf *.jpg
Calc03-048.jpg JPEG 1200x1526 1200x1526+0+0 8-bit DirectClass 767KB 0.150u 0:00.210
Calc03-048.jpg=>/tmp/magick-hBgCr0sL JPEG 1200x1526 1200x1526+0+0 8-bit DirectClass 758KB 0.240u 0:00.250
Calc03-048.jpg=>/tmp/magick-2-F0q41n JPEG 1200x1526=>83x106 8-bit DirectClass 4.1KB 0.000u 0:00.000
Calc03-048.jpg=>Calc03-048.pdf JPEG 1200x1526 1200x1526+0+0 8-bit DirectClass 770KB 0.390u 0:00.480
Calc03-049-050.jpg JPEG 1200x1492 1200x1492+0+0 8-bit DirectClass 776KB 0.320u 0:00.379
Calc03-049-050.jpg=>/tmp/magick-BO6Ftuq1 JPEG 1200x1492 1200x1492+0+0 8-bit DirectClass 831KB 0.350u 0:00.370
Calc03-049-050.jpg=>/tmp/magick-DDLMbjPF JPEG 1200x1492=>85x106 8-bit DirectClass 8.19KB 0.010u 0:00.009
Calc03-049-050.jpg=>Calc03-049-050.pdf JPEG 1200x1492 1200x1492+0+0 8-bit DirectClass 844KB 0.510u 0:00.570
Notice how on the third result line for each file a “=>83x106” is returned, while this was the original filesize, still this causes my “something’s wrong” alarm to go off. Resultingly, I import the newly formed file into gimp, and on the “import from pdf” opening screen Gimp shows “width(pixels): 400”.
Ahhh!! ;(...
So I then know my previous misgivings arising from “=>83x106” were accurate. Thus I delete all the pdf files, and retry with:
sudo mogrify -verbose -format pdf -resize 1200 -quality 100% *.jpg
Calc03-049-050.jpg JPEG 1200x1492 1200x1492+0+0 8-bit DirectClass 776KB 0.320u 0:00.339
Calc03-049-050.jpg=>/tmp/magick-zGwu26ca JPEG 1200x1492 1200x1492+0+0 8-bit DirectClass 831KB 0.350u 0:00.350
Calc03-049-050.jpg=>/tmp/magick-WtKuOIYg JPEG 1200x1492=>85x106 8-bit DirectClass 8.19KB 0.000u 0:00.000
Calc03-049-050.jpg=>Calc03-049-050.pdf JPEG 1200x1492 1200x1492+0+0 8-bit DirectClass 844KB 0.500u 0:00.510
Calc03-051.jpg JPEG 1200x463 1200x463+0+0 8-bit DirectClass 246KB 0.060u 0:00.059
Calc03-051.jpg=>/tmp/magick--HYekWWn JPEG 1200x463 1200x463+0+0 8-bit DirectClass 246KB 0.080u 0:00.140
Calc03-051.jpg=>/tmp/magick-GIwUmzov JPEG 1200x463=>106x41 8-bit DirectClass -0.000u 0:00.000
Calc03-051.jpg=>Calc03-051.pdf JPEG 1200x463 1200x463+0+0 8-bit DirectClass 250KB 0.200u 0:00.279
Again, you notice the same “=>85x106” note on every third line. When checking the width of the pdf page (pixels) via importing a file into GIMP, I then find a “width(pixels): 1200” reading, so to combine the different pdf files into one pdf file, I then enter:
3) pdftk *.pdf cat output CalcCh03.pdf
I then open up the file, and alas, the pages are still different widths.
Morbidly, I go back to the second step and try with a 640 width, which produces the same exact results.
Any solutions? I don’t have $1000USD for the adobe photoshop pro software package, so that isn’t an option.
Andrew Comly
andrew.comly@gmail.com