SimpleScan saves PDFs as very large (26.6MiB) files per Page

Bug #853648 reported by BeowulfOF
106
This bug affects 18 people
Affects Status Importance Assigned to Milestone
Simple Scan
Fix Released
High
Unassigned
simple-scan (Ubuntu)
Fix Released
High
Unassigned
Oneiric
Fix Released
Wishlist
Unassigned

Bug Description

beowulf@seashell:~$ lsb_release -rd
Description: Ubuntu oneiric (development branch)
Release: 11.10
beowulf@seashell:~$ apt-cache policy simple-scan
simple-scan:
  Installiert: 3.1.91-0ubuntu1
  Kandidat: 3.1.91-0ubuntu1
  Versionstabelle:
 *** 3.1.91-0ubuntu1 0
        500 http://de.archive.ubuntu.com/ubuntu/ oneiric/main amd64 Packages
        100 /var/lib/dpkg/status

scan a normal page of b/w text and save it as jpg and in pdf-format.
The jpg will have a final size of about 1 MiB, where the pdf will end up with 26.6 MiB on disk.

Before (natty) scanning and saving a normal page endet in an pdf of about 1MiB in size.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: simple-scan 3.1.91-0ubuntu1
ProcVersionSignature: Ubuntu 3.0.0-10.16-generic 3.0.4
Uname: Linux 3.0.0-10-generic x86_64
NonfreeKernelModules: wl
ApportVersion: 1.23-0ubuntu1
Architecture: amd64
Date: Mon Sep 19 07:02:36 2011
DriverPackageVersions:
 libsane 1.0.22-2ubuntu1
 libsane-extras N/A
 hplip 3.11.7-0ubuntu5
 hpoj N/A
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Beta amd64+mac (20110413)
MachineType: ASUSTeK Computer INC. 1215N
ProcEnviron:
 PATH=(custom, no user)
 LANG=de_DE.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-3.0.0-10-generic root=UUID=1ad03914-e349-424e-8854-e03998ae3a37 ro quiet splash vt.handoff=7
SourcePackage: simple-scan
UpgradeStatus: Upgraded to oneiric on 2011-09-14 (5 days ago)
dmi.bios.date: 12/20/2010
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 0605
dmi.board.asset.tag: To Be Filled By O.E.M.
dmi.board.name: 1215N
dmi.board.vendor: ASUSTeK Computer INC.
dmi.board.version: x.xx
dmi.chassis.asset.tag: 0x00000000
dmi.chassis.type: 10
dmi.chassis.vendor: ASUSTeK Computer INC.
dmi.chassis.version: x.x
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr0605:bd12/20/2010:svnASUSTeKComputerINC.:pn1215N:pvrx.x:rvnASUSTeKComputerINC.:rn1215N:rvrx.xx:cvnASUSTeKComputerINC.:ct10:cvrx.x:
dmi.product.name: 1215N
dmi.product.version: x.x
dmi.sys.vendor: ASUSTeK Computer INC.

Revision history for this message
BeowulfOF (beowulfof) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in simple-scan (Ubuntu):
status: New → Confirmed
Revision history for this message
Jamie Jones (jbjonesjr) wrote :

Can confirm this impacts me as well. System information:
Linux dell-desktop 3.0.0-12-generic-pae #20-Ubuntu SMP Fri Oct 7 16:37:17 UTC 2011 i686 i686 i386 GNU/Linux

Scanning Device is (from lsusb):
Bus 001 Device 004: ID 03f0:7411 Hewlett-Packard

Revision history for this message
Alex Peters (alex-peters) wrote :

This impacts me as well.

I really wish I'd noticed this before destroying the original papers and uploading over half a gigabyte (for only 40 A4 pages) to Ubuntu One.

Is there a way to fix the size of these existing files without losing scan quality or requiring a re-scan?

Revision history for this message
Edward (edwardtisdale-2004) wrote :

Simple-scan does this, but I am able to scan easy with Xsane.

Revision history for this message
Marcin Dylewski (marcin-dylewski-m) wrote :

Another confirmation here.

Revision history for this message
Marcin Dylewski (marcin-dylewski-m) wrote :

I've tried xsane but files are still far larger then generated by simple-scan on Natty. At 150dpi they were around 300kB in size while now they are 1,6MB. Any ideas?

Revision history for this message
Manuel (manuel-haas) wrote :

Quick an dirty: just open and save the pdf in libreoffice. I've checked gconf options already, but there are not more options than in the application itself.

Revision history for this message
Steven Fosdick (sjfother) wrote :

I suspect simplescan is not using any compression when saving the images to the PDF file. Another work-around, if you have ImageMagick installed:

convert -compress JPEG file-from-simplescan.pdf new-file.pdf

Changed in simple-scan:
status: New → Triaged
Changed in simple-scan (Ubuntu):
status: Confirmed → Triaged
Changed in simple-scan:
importance: Undecided → High
Changed in simple-scan (Ubuntu):
importance: Undecided → High
Revision history for this message
Matthew Kennedy (lispnik) wrote :

Hi, The current code allocates a maximized buffer to write the JPEG into but never resizes that buffer afterwards hence the PDF is large. The fix is to resize the buffer to the actual size of the compressed JPEG data (see attached patch).

> du -sh Scanned\ Document*.pdf
1.1M Scanned Document-fixed.pdf
26M Scanned Document.pdf

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Resize JPEG buffer in PDF case" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Thanks lispnik! I confirmed your patch works and have released a new 3.2.1 version with this fix. I will request a SRU for this into Oneiric.

Changed in simple-scan:
status: Triaged → Fix Released
Changed in simple-scan (Ubuntu):
status: Triaged → Fix Released
status: Fix Released → Fix Committed
status: Fix Committed → Fix Released
Revision history for this message
Robert Ancell (robert-ancell) wrote :

To reproduce:
1. Open Simple Scan
2. Set scan mode to Photo (drop down beside scan button)
3. Scan a page of text
4. Save to a PDF
Expected result:
A PDF of ~1M is produced
Observed result
A PDF of ~26M is produced

Changed in simple-scan (Ubuntu Oneiric):
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello BeowulfOF, or anyone else affected,

Accepted simple-scan into oneiric-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in simple-scan (Ubuntu Oneiric):
status: Triaged → Fix Committed
tags: added: verification-needed
Revision history for this message
Jed Vees (edviesturs) wrote :

I installed the oneric-proposed version (3.2.1). My Canon CanoScan N1220U is now outputting nothing but solid black. The same issue is now happening in xsane as well.

I suspect my issue is related to the older Bug #680892 - I will attach the pdf file. Unfortunately I will be away for several days and won't be able to do more testing...

Revision history for this message
Jed Vees (edviesturs) wrote :

Black scan generated after upgrading to the oneric-proposed Simple-Scan 3.2.1

Revision history for this message
Matthew Kennedy (lispnik) wrote :

Hi Jed, I think your problem is not related to this specific bug because you get the same behavior in xsane, which isn't directly related to this fix. Have you tried disconnecting your scanner and then plugging it back in? Occasionally, I have to disconnect/reconnect my Canon LiDE 200 to make it work.

Attached is my scan PDF (~300 kB) using the oneiric proposed build.

> dpkg -l |grep simple-scan
ii simple-scan 3.2.1-0ubuntu1~oneiric1 Simple Scanning Utility

Revision history for this message
Miklos Juhasz (mjuhasz) wrote :

The proposed version works well for me. The pdf I saved is about 1.2MB as it should be.

tags: added: verification-done
removed: verification-needed
Revision history for this message
BeowulfOF (beowulfof) wrote :

For me the bug is fixed with this version, just verified the result.

Thank you guys, very good work!

Revision history for this message
Jed Vees (edviesturs) wrote :

Matthew Kennedy (lispnik)'s suggestion to unplug/reconnect the scanner fixed by black scans. Things are now working great. Thanks guys!

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package simple-scan - 3.2.1-0ubuntu1~oneiric1

---------------
simple-scan (3.2.1-0ubuntu1~oneiric1) oneiric-proposed; urgency=low

  * New upstream release
    - Fix JPEG compression not working in PDF files (LP: #853648)
 -- Robert Ancell <email address hidden> Wed, 09 Nov 2011 11:31:38 +1100

Changed in simple-scan (Ubuntu Oneiric):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.