I’m scanning old family photos with a Canon LiDE 400 using scanimage but the scanner outputs/scans the whole scanning surface, not only the photo. I’m working in the Linux terminal and I’d rather not install a GUI at this time. If I did, I’d simply use XSane to crop the image. The scanner doesn’t have any length/width markings along its edges, otherwise I’d just input the dimensions of the photo.

Any solutions?

  • Beej Jorgensen@lemmy.sdf.org
    link
    fedilink
    arrow-up
    3
    ·
    7 hours ago

    If I want to scan a 100mm wide by 50mm tall area at 300 DPI, I use:

    scanimage -x 100 -y 150 --resolution 300 --output-file foo.jpg
    
    • printf("%s", name);@piefed.blahaj.zoneOP
      link
      fedilink
      English
      arrow-up
      4
      ·
      7 hours ago

      Thanks! I did end up setting the X and Y measurements. It’s just too bad that my scanners scanning points do not start exactly in the corner of the scanner. It was a somewhat cheapo scanner, so I guess I got what I paid for.

      • Beej Jorgensen@lemmy.sdf.org
        link
        fedilink
        arrow-up
        2
        ·
        4 hours ago

        I ended up writing a wrapper shell script that added a fudge value onto the x and y so I wouldn’t have to do it myself every time. :)

  • Ooops@feddit.org
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    7 hours ago

    Only that scanimage’s manpages (was suprised to have it installed as a requriment of some GUI app…) talk about -x <value> and -y <value>parameters, with the caveat that the specific device has to support it.

    Also: -l (top-left x position of scanned area), and possibly (if supported) -t (y posiiton)

    PS: All values in millimeters

    PPS: Did a quick test.
    At least my scanner worked with scanimage -l 50 -t 50 -x 100 -y 100 > test.pnm to produce a (rounding errors included) 10cmx10cm scan

    Correction… no, it does not. The -t option is ignored. But such things could be probably handled by placing of the original in your use case.