TWAIN Working Group

Newsletter Signup
Donate
Help keep TWAIN free
  • About TWAIN
    • What’s New?
    • News
    • Events
    • Membership
    • Consider a Donation
    • Contact Us
  • Why TWAIN?
  • Developers
    • Driver Developer
    • Application Developer
    • TWAIN Features
    • Specification & Tools
    • Self Certification Process
  • Support Forums
  • Scanner End-User
  • Find Certified Drivers
    • Facebook
    • LinkedIn
    • Vimeo

Scanned images have same size in file transfer mode

Forums › TWAIN Classic › Scanned images have same size in file transfer mode

  • This topic has 5 replies, 6 voices, and was last updated 7 years, 1 month ago by Foximage.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • April 2, 2013 at 5:23 am #22837 Reply
    kannanprathesh
    Participant
    • Topics - 5
    • Replies - 1
    • Total Posts - 6

    Hi,
    I have developing scanner application in C++. Currently I am able to scanning the documents and get the images in file transfer mode. But all the scanned documents have same size even though the content of the documents are different.

    FileFormat:TWFF_TIFF
    Pixel flavout: TWPF_CHOCOLATE
    Xresoultion:75
    Yresoultion:75
    ICAP_UNITS: TWUN_INCHES
    ICAP_PIXELTYPE: TWPT_GRAY
    ICAP_BRIGHTNESS:0
    ICAP_CONTRAST:0
    ICAP_BITDEPTH: 8

    Every time scanned image size as 327kb. What I did wrong or I missed anything else? Please assist me. One more question how can I set JPEG_Compression. Is file transfer mode supports JPEG_compression?

    Thanks
    Kannan

    April 2, 2013 at 7:31 pm #25858 Reply
    MarkM
    Participant
    • Topics - 1
    • Replies - 135
    • Total Posts - 136

    Hi Kannan…

    An application sets ICAP_COMPRESSION to TWCP_JPEG to request JPEG compression. The best value for a file transfer is then TWFF_JFIF, which should result in a .jpg file.

    While it’s possible to wrap JPEG inside of TIFF, not all TIFF viewers will be able to display it.

    — Mark

    April 8, 2013 at 4:05 pm #25859 Reply
    spike
    Participant
    • Topics - 10
    • Replies - 139
    • Total Posts - 149

    Hi Kannan – yes, probably your scanner/driver is writing the TIFF file with no compression, so if each scan is the same number of pixels, the file size will also be the same.

    It is fairly common that grayscale and color scans are written to TIFF without any compression, because the only compression that works well on these scans is JPEG, and there are compatibility problems with using JPEG compression in TIFF files. (Briefly: JPEG compression was badly standardized in TIFF 6.0, that was repudiated and replaced with a superior but incompatible version in TIFF Technical Note #2 (TTN2) – so there are two incompatible ways to use JPEG compression in a TIFF file: ‘Old Style’ or ‘Wang’ JPEG and ‘New Style’ or ‘TTN2’ JPEG. Some software reads one, some reads the other, some reads both but only writes one, etc.)

    You can try selecting TIFF file format by setting ICAP_IMAGEFILEFORMAT to TWFF_TIFF, then setting the compression algorithm to JPEG by setting ICAP_COMPRESSION to TWCP_JPEG. It is up to your scanner’s TWAIN driver to decide whether it supports this. And you won’t really know which flavor of JPEG-in-TIFF you get until you examine the resulting TIFF file.

    I recommend AsTiffTagViewer from Aware Systems, for viewing the metadata of TIFF files:
    http://www.awaresystems.be/imaging/tiff/astifftagviewer.html

    May 14, 2013 at 3:59 am #25860 Reply
    Wallism
    Participant
    • Topics - 0
    • Replies - 8
    • Total Posts - 8

    The following code shows how to control acquired image position and size:

    this.device.Units = UnitType.Inches;
    if (this.device.Units != UnitType.Inches) return;
    this.device.Frame = new System.Drawing.RectangleF(0, 0, 8.5, 11);

    Does this work ?I found that from Twain Scanning in C#.NETby google.

    December 16, 2013 at 3:24 am #25861 Reply
    peterlee
    Participant
    • Topics - 0
    • Replies - 24
    • Total Posts - 24

    Hi, Wallism.
    I am also testing with the related
    Twain Scanners and learning to build TIFF scanner with the help of some manual tools which can be customized by users according to our own favors to help view and scan tiff files these days. You can also google it and select one whose way of processing is simple and fast to help you with the related work. Remember to check its free trial package first if possible. I hope you success. Good luck.

    Best regards,
    Peter

    December 18, 2013 at 2:43 am #25862 Reply
    Foximage
    Participant
    • Topics - 0
    • Replies - 13
    • Total Posts - 13

    Implment a mature TWAIN scanning add-on which is developed to capture digital images with a TWAIN (32 and 64 bit) device driver, including digital camera, scanners, and more. During the scanning, it is very easy to detect & define image compression modes, frame sizes, resolutions, etc.

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Scanned images have same size in file transfer mode
Your information:




Quick Links

Service Providers
TWAIN Support Forums
Membership
Contact Us
Privacy Policy

Newsletter Signup

TWAIN Working Group Family

TWAIN Working Group
TWAIN Direct®
TWAIN Resources
TWAIN Certified Drivers
PDF/raster

  • Facebook
  • GitHub
  • LinkedIn
  • Vimeo

Recent Topics

  • Girls of Desire: All babes in one place, crazy, art
  • EPSON V600 TWAIN and WIA on Windows 10
  • When and how to use WaitForEvents command ?
  • Problem enumerating list of installed scanners in windows server 2012
  • Failed to create TWAIN progress! Error code is 1260.
  • Quarterly Newsletter
  • TWAIN Working Group Membership
  • Logo Usage
  • TWAIN License
  • Contact Us
Privacy Policy • Privacy Tools • Copyright © 2021 TWAIN Working Group • by iHwy, LLC • Log in

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.