boostorg / boostorg/gil

Writing a gray16 PNG image on disk always results on an empty (all 0) image.

Aperta
#223 20 commenti 0 reazioni 0 assegnatari Vedi su GitHub
ext/io status/need-test
Lingua principale
C++
Stelle
199
Fork
171
Merge medio
1g 14h
PR unite (30g)
10

Descrizione

When writing a gray16 PNG image, none error will arise at compile time or runtime, and the resulting image on disk will have all pixels with a value of '0'.

The following code reproduces the bug:

#include
#include
#include

namespace bg = boost::gil;

int main(int argc, char *argv[])
{
auto img = bg::gray16_image_t {10, 20, bg::gray16_pixel_t {0}};
auto view = bg::view(img);
auto count = std::uint16_t {0};
for (auto it = view.begin(); it != view.end(); ++it)
{
*it = count++;
}

bg::write_view("img.png", bg::const_view(img), bg::png_tag());
return 0;
}

When changing the image/view types to gray8 on code above, a correct image is wrote.

The used system is an up to date ArchLinux with gcc 8.2.1, boost 1.69, libpng 1.6.36.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.