Changeset View
Changeset View
Standalone View
Standalone View
source/blender/imbuf/intern/jpeg.c
| Context not available. | |||||
| uchar *rect; | uchar *rect; | ||||
| int x, y; | int x, y; | ||||
| char neogeo[128]; | char neogeo[128]; | ||||
| ImMetaData *iptr; | |||||
| char *text; | char *text; | ||||
| void *iter; | |||||
| jpeg_start_compress(cinfo, true); | jpeg_start_compress(cinfo, true); | ||||
| Context not available. | |||||
| jpeg_write_marker(cinfo, 0xe1, (JOCTET *) neogeo, 10); | jpeg_write_marker(cinfo, 0xe1, (JOCTET *) neogeo, 10); | ||||
| if (ibuf->metadata) { | if (ibuf->metadata) { | ||||
| IDProperty *prop; | |||||
| /* key + max value + "Blender" */ | /* key + max value + "Blender" */ | ||||
| text = MEM_mallocN(530, "stamp info read"); | text = MEM_mallocN(530, "stamp info read"); | ||||
| iptr = ibuf->metadata; | iter = IDP_GetGroupIterator((IDProperty*)ibuf->metadata); | ||||
| while (iptr) { | for (prop=IDP_GroupIterNext(iter); prop; prop=IDP_GroupIterNext(iter)) { | ||||
| if (!strcmp(iptr->key, "None")) { | if (prop->type == IDP_STRING){ | ||||
| jpeg_write_marker(cinfo, JPEG_COM, (JOCTET *) iptr->value, strlen(iptr->value) + 1); | if (!strcmp(prop->name, "None")) { | ||||
| goto next_stamp_info; | jpeg_write_marker(cinfo, JPEG_COM, (JOCTET *) IDP_String(prop), strlen((char*) IDP_String(prop) + 1)); | ||||
| } | } | ||||
| /* | /* | ||||
| Context not available. | |||||
| * The first "Blender" is a simple identify to help | * The first "Blender" is a simple identify to help | ||||
| * in the read process. | * in the read process. | ||||
| */ | */ | ||||
| sprintf(text, "Blender:%s:%s", iptr->key, iptr->value); | sprintf(text, "Blender:%s:%s", prop->name, IDP_String(prop)); | ||||
| jpeg_write_marker(cinfo, JPEG_COM, (JOCTET *) text, strlen(text) + 1); | jpeg_write_marker(cinfo, JPEG_COM, (JOCTET *) text, strlen(text) + 1); | ||||
| next_stamp_info: | } | ||||
| iptr = iptr->next; | |||||
| } | } | ||||
| MEM_freeN(text); | MEM_freeN(text); | ||||
| } | } | ||||
| Context not available. | |||||