MCPcopy Create free account
hub / github.com/LibRaw/LibRaw / write_thumb

Function write_thumb

samples/mem_image_sample.cpp:119–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119void write_thumb(libraw_processed_image_t *img, const char *basename)
120{
121 if (!img)
122 return;
123
124 if (img->type == LIBRAW_IMAGE_BITMAP)
125 {
126 char fnt[1024];
127 snprintf(fnt, 1024, "%s.thumb", basename);
128 write_ppm(img, fnt);
129 }
130 else if (img->type == LIBRAW_IMAGE_JPEG)
131 {
132 char fn[1024];
133 snprintf(fn, 1024, "%s.thumb.jpg", basename);
134 FILE *f = fopen(fn, "wb");
135 if (!f)
136 return;
137 fwrite(img->data, img->data_size, 1, f);
138 fclose(f);
139 }
140}
141
142int main(int ac, char *av[])
143{

Callers 1

mainFunction · 0.85

Calls 1

write_ppmFunction · 0.70

Tested by

no test coverage detected