boostorg / boostorg/gil

TIFF I/O asserts with empty image

Open
#224 1 comment 0 reactions 0 assignees View on GitHub
ext/io
Dominant language
C++
Stars
199
Forks
171
Avg merge
1d 14h
Merged PRs (30d)
10

Description

### Minimal Working Example (in C++)

```cpp
/* whatever image type*/ image(); //empty image
tiff_write_view("test.tif", image);
```

### Actual behavior

Assert: `front() called on empty vector` reported by MSVC in Debug
In file `boost\gil\extension\io\tiff\detail\write.hpp`.

### Expected behavior

Parameter checking should be done upfront, maybe in `write_view()`.

### Notes

This might apply to other I/O extensions.

Also, could you fix the indentation in the I/O extension files (mix of tabs / space)? Or are you planning on generalizing the use of `clang-format` in the future?

TBH, I am a bit puzzled with the new I/O framework (I have extensions written the old way). Looking at the TIFF format for instance:

Old: 29 KB in two files
New: 114 KB in 13 files

What are the new functionalities that require such a large number of additional code? Furthermore the documentation in "Extending GIL::IO with new Formats" makes it sound like it's an easy job :-)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.