Changeset View
Changeset View
Standalone View
Standalone View
source/blender/imbuf/intern/png.c
| Context not available. | |||||
| png_bytepp row_pointers = NULL; | png_bytepp row_pointers = NULL; | ||||
| int i, bytesperpixel, color_type = PNG_COLOR_TYPE_GRAY; | int i, bytesperpixel, color_type = PNG_COLOR_TYPE_GRAY; | ||||
| FILE *fp = NULL; | FILE *fp = NULL; | ||||
| void *meta_iter; | |||||
| bool is_16bit = (ibuf->ftype & PNG_16BIT) != 0; | bool is_16bit = (ibuf->ftype & PNG_16BIT) != 0; | ||||
| bool has_float = (ibuf->rect_float != NULL); | bool has_float = (ibuf->rect_float != NULL); | ||||
| Context not available. | |||||
| /* image text info */ | /* image text info */ | ||||
| if (ibuf->metadata) { | if (ibuf->metadata) { | ||||
| png_text *metadata; | png_text *metadata; | ||||
| ImMetaData *iptr; | IDProperty *prop; | ||||
| int num_text = 0; | int num_text = 0; | ||||
| iptr = ibuf->metadata; | meta_iter = IDP_GetGroupIterator((IDProperty*)ibuf->metadata); | ||||
| while (iptr) { | for (prop=IDP_GroupIterNext(meta_iter); prop; prop=IDP_GroupIterNext(meta_iter)) { | ||||
| num_text++; | if (prop->type == IDP_STRING){ | ||||
sergey: Same as above. | |||||
| iptr = iptr->next; | num_text++; | ||||
| } | |||||
| } | } | ||||
| metadata = MEM_callocN(num_text * sizeof(png_text), "png_metadata"); | metadata = MEM_callocN(num_text * sizeof(png_text), "png_metadata"); | ||||
| iptr = ibuf->metadata; | meta_iter = IDP_GetGroupIterator((IDProperty*)ibuf->metadata); | ||||
| num_text = 0; | num_text = 0; | ||||
| while (iptr) { | for (prop=IDP_GroupIterNext(meta_iter); prop; prop=IDP_GroupIterNext(meta_iter)) { | ||||
Not Done Inline ActionsAnd again. sergey: And again. | |||||
| if (prop->type == IDP_STRING){ | |||||
| metadata[num_text].compression = PNG_TEXT_COMPRESSION_NONE; | metadata[num_text].compression = PNG_TEXT_COMPRESSION_NONE; | ||||
| metadata[num_text].key = iptr->key; | metadata[num_text].key = prop->name; | ||||
| metadata[num_text].text = iptr->value; | metadata[num_text].text = IDP_String(prop); | ||||
| num_text++; | num_text++; | ||||
| iptr = iptr->next; | } | ||||
| } | } | ||||
| png_set_text(png_ptr, info_ptr, metadata, num_text); | png_set_text(png_ptr, info_ptr, metadata, num_text); | ||||
| Context not available. | |||||
Same as above.