Commit 19e3dee
fix(oiiotool): Ignore empty subimage(s) when calculating non-zero region (#4909)
Fixes #4799
When trimming an image that contains an empty subimage, the resulting
ROI unexpectedly included the top-left pixel even if zero in all
subimages.
To avoid this, empty ROIs are ignored when computing the overall
non-zero region.
If all subimages are empty, the first subimage ROI is used and doctored
to be 1 pixel.
Two tests have been added to the oiiotool testsuite:
- 1 to check the trimming of an empty image
- 1 to check the trimming of a non-empty image with an empty subimage
Signed-off-by: Carine Touraille <[email protected]>1 parent 71248f7 commit 19e3dee
File tree
5 files changed
+26
-8
lines changed- src/oiiotool
- testsuite/oiiotool
- ref
5 files changed
+26
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4077 | 4077 | | |
4078 | 4078 | | |
4079 | 4079 | | |
4080 | | - | |
4081 | | - | |
4082 | | - | |
4083 | | - | |
4084 | | - | |
4085 | | - | |
| 4080 | + | |
| 4081 | + | |
4086 | 4082 | | |
4087 | | - | |
| 4083 | + | |
| 4084 | + | |
| 4085 | + | |
| 4086 | + | |
| 4087 | + | |
| 4088 | + | |
| 4089 | + | |
| 4090 | + | |
4088 | 4091 | | |
4089 | 4092 | | |
4090 | 4093 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
71 | 73 | | |
72 | 74 | | |
| 75 | + | |
| 76 | + | |
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
| |||
Binary file not shown.
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
108 | 112 | | |
109 | 113 | | |
110 | 114 | | |
111 | 115 | | |
112 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
113 | 123 | | |
114 | 124 | | |
115 | 125 | | |
| |||
262 | 272 | | |
263 | 273 | | |
264 | 274 | | |
265 | | - | |
| 275 | + | |
| 276 | + | |
266 | 277 | | |
267 | 278 | | |
268 | 279 | | |
| |||
0 commit comments