Lines 332-337
Link Here
|
332 |
png_set_expand(png_ptr); |
332 |
png_set_expand(png_ptr); |
333 |
} |
333 |
} |
334 |
|
334 |
|
|
|
335 |
if (png_get_sRGB && png_get_sRGB(png_ptr, info_ptr, &intent)) { |
336 |
png_set_sRGB(png_ptr, info_ptr, intent); |
337 |
} else if (png_get_gAMA) { |
338 |
double gamma; |
339 |
if (!png_get_gAMA(png_ptr, info_ptr, &gamma)) { |
340 |
gamma = 0.45455; |
341 |
} |
342 |
png_set_gamma(png_ptr, 1.0, gamma); |
343 |
} |
344 |
|
335 |
png_read_update_info(png_ptr,info_ptr); |
345 |
png_read_update_info(png_ptr,info_ptr); |
336 |
block.pixelSize = png_get_channels(png_ptr, info_ptr); |
346 |
block.pixelSize = png_get_channels(png_ptr, info_ptr); |
337 |
block.pitch = png_get_rowbytes(png_ptr, info_ptr); |
347 |
block.pitch = png_get_rowbytes(png_ptr, info_ptr); |
Lines 353-368
Link Here
|
353 |
block.offset[3] = 0; |
363 |
block.offset[3] = 0; |
354 |
} |
364 |
} |
355 |
|
365 |
|
356 |
if (png_get_sRGB && png_get_sRGB(png_ptr, info_ptr, &intent)) { |
|
|
357 |
png_set_sRGB(png_ptr, info_ptr, intent); |
358 |
} else if (png_get_gAMA) { |
359 |
double gamma; |
360 |
if (!png_get_gAMA(png_ptr, info_ptr, &gamma)) { |
361 |
gamma = 0.45455; |
362 |
} |
363 |
png_set_gamma(png_ptr, 1.0, gamma); |
364 |
} |
365 |
|
366 |
png_data= (char **) ckalloc(sizeof(char *) * info_height + |
366 |
png_data= (char **) ckalloc(sizeof(char *) * info_height + |
367 |
info_height * block.pitch); |
367 |
info_height * block.pitch); |
368 |
|
368 |
|