[sane-devel] [PATCH 1/2] add PNG format to scanimage

Matteo Croce matteo at openwrt.org
Sun Sep 13 02:06:15 UTC 2015


2015-09-12 9:13 GMT+02:00 Olaf Meeuwissen <paddy-hack at member.fsf.org>:
> Hi Matteo,
>
> Thanks for taking the trouble to add optional PNG and JPEG output
> support!
>
> I've done a quick review of both patches and there are a few things that
> I'd like to point out:
>
>  - Why do you let users select PNG/JPEG outputs even when the support is
>    not available when HAVE_LIBPNG and/or HAVE_LIBJPEG are undefined?

If the user selects JPEG/PNG when support is not compiled in it gets
an error message:
fprintf(stderr, "XXX support not compiled in\n");

>  - Aren't you leaking memory?  The malloc is inside a do-while but the
>    free is on the outside.

the malloc is in "if(first_frame)" so it's called only once per file

>  - It would be nice to update the scanimage manual page to mention the
>    (potential) support for these image formats.

right, will do in v2

> Hope this helps,
> --
> Olaf Meeuwissen, LPIC-2            FSF Associate Member since 2004-01-27
> Support Free Software               Support the Free Software Foundation
> https://my.fsf.org/donate                        https://my.fsf.org/join



-- 
Matteo Croce
OpenWrt Developer
  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 CHAOS CALMER
 -----------------------------------------------------
  * 1 1/2 oz Gin            Shake with a glassful
  * 1/4 oz Triple Sec       of broken ice and pour
  * 3/4 oz Lime Juice       unstrained into a goblet.
  * 1 1/2 oz Orange Juice
  * 1 tsp. Grenadine Syrup
 -----------------------------------------------------



More information about the sane-devel mailing list