[sane-devel] [BUG] Duplicate SANE_NAME in saneopts.h
m. allan noah
kitno455 at gmail.com
Wed Jul 9 01:43:18 UTC 2008
On 7/8/08, Olaf Meeuwissen <olaf.meeuwissen at avasys.jp> wrote:
> Checking out why setting X/Y resolutions independently didn't quite
> work as expected, I discovered that saneopts.h has this:
>
> #define SANE_NAME_SCAN_RESOLUTION "resolution"
> #define SANE_NAME_SCAN_X_RESOLUTION "resolution"
> #define SANE_NAME_SCAN_Y_RESOLUTION "y-resolution"
>
> That means that trying to set the X resolution always does the same
> thing as setting the scan resolution. I think that is incorrect in
> the general case and suggest the above gets changed to:
>
> #define SANE_NAME_SCAN_RESOLUTION "resolution"
> #define SANE_NAME_SCAN_X_RESOLUTION "x-resolution"
> #define SANE_NAME_SCAN_Y_RESOLUTION "y-resolution"
>
> So that backend implementations can distinguish these cases if they
> want to. The corresponding descriptions for these option hint that
> setting the image's scan resolution is not necessarily the same as
> setting the horizontal scan resolution.
>
> In my particular situation, I have a use case where it makes sense to
> use SANE_NAME_SCAN_RESOLUTION with one set of allowed resolutions and
> different sets of allowed resolutions for the individual horizontal
> and vertical resolution settings.
>
> On a more general note, there is no point in having different option
> name macros that resolve to the same name. All of the SANE_NAME_*
> macros should be unique. At the moment (sane-backends-1.0.19), only
> SANE_NAME_SCAN_X_RESOLUTION is not unique.
>
> I don't think that the suggested change will break any of the current
> backends and frontends, but would like to ask everyone to take a look
> and comment on my suggestion before I file a bug report.
i agree with your assessment, but i am not sure i can envision a use
case with all three controls active at the same time. or, are you
going to have a locked/unlocked choice that switches between the two
sets?
allan
--
"The truth is an offense, but not a sin"
More information about the sane-devel
mailing list