- volatile int need_scale = io->cols != rd->cols || io->rows != rd->rows;
- struct image * volatile img = need_scale ?
- image_new(io->thread, rd->cols, rd->rows, io->flags & IMAGE_PIXEL_FORMAT, NULL) :
- image_new(io->thread, rd->cols, rd->rows, io->flags, io->pool);
- if (!img)
- {
- png_destroy_read_struct(&rd->png_ptr, &rd->info_ptr, &rd->end_ptr);
- return 0;
- }