Skip to content
GitLab
About GitLab
GitLab: the DevOps platform
Explore GitLab
Install GitLab
How GitLab compares
Get started
GitLab docs
GitLab Learn
Pricing
Talk to an expert
/
Help
What's new
2
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Projects
Groups
Snippets
Sign up now
Login
Sign in / Register
Toggle navigation
Menu
Open sidebar
libtiff
libtiff
Commits
bad48e90
Commit
bad48e90
authored
Aug 20, 2022
by
Su Laus
Browse files
tiffcrop -S option: Make decision simpler.
parent
8fe37359
Changes
1
Hide whitespace changes
Inline
Side-by-side
tools/tiffcrop.c
View file @
bad48e90
...
...
@@ -2133,11 +2133,11 @@ void process_command_opts (int argc, char *argv[], char *mp, char *mode, uint32
}
/*-- Check for not allowed combinations (e.g. -X, -Y and -Z, -z and -S are mutually exclusive) --*/
char
XY
,
Z
,
R
,
S
;
XY
=
((
crop_data
->
crop_mode
&
CROP_WIDTH
)
||
(
crop_data
->
crop_mode
&
CROP_LENGTH
));
Z
=
(
crop_data
->
crop_mode
&
CROP_ZONES
);
R
=
(
crop_data
->
crop_mode
&
CROP_REGIONS
);
S
=
(
page
->
mode
&
PAGE_MODE_ROWSCOLS
);
if
(
(
XY
&&
Z
)
||
(
XY
&&
R
)
||
(
XY
&&
S
)
||
(
Z
&&
R
)
||
(
Z
&&
S
)
||
(
R
&&
S
)
)
{
XY
=
((
crop_data
->
crop_mode
&
CROP_WIDTH
)
||
(
crop_data
->
crop_mode
&
CROP_LENGTH
))
?
1
:
0
;
Z
=
(
crop_data
->
crop_mode
&
CROP_ZONES
)
?
1
:
0
;
R
=
(
crop_data
->
crop_mode
&
CROP_REGIONS
)
?
1
:
0
;
S
=
(
page
->
mode
&
PAGE_MODE_ROWSCOLS
)
?
1
:
0
;
if
(
XY
+
Z
+
R
+
S
>
1
)
{
TIFFError
(
"tiffcrop input error"
,
"The crop options(-X|-Y), -Z, -z and -S are mutually exclusive.->Exit"
);
exit
(
EXIT_FAILURE
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment