Image Stamping patch by Diego (and peach request)- stamps image info into metadata...
[blender.git] / source / blender / imbuf / intern / thumbs.c
index 493b0968f55bb63d02602ee72b1141ee456a494c..131d2ef38f7c84f169b42d3e9e214c0964dc91c7 100644 (file)
@@ -281,7 +281,7 @@ ImBuf* IMB_thumb_create(const char* dir, const char* file, ThumbSize size, Thumb
                        if (THB_SOURCE_IMAGE == source) {
                                BLI_getwdN(wdir);
                                chdir(dir);
-                               img = IMB_loadiffname(file, IB_rect);
+                               img = IMB_loadiffname(file, IB_rect | IB_imginfo);
                                if (img != NULL) {
                                        stat(file, &info);
                                        sprintf(mtime, "%ld", info.st_mtime);
@@ -324,13 +324,13 @@ ImBuf* IMB_thumb_create(const char* dir, const char* file, ThumbSize size, Thumb
                        IMB_scaleImBuf(img, ex, ey);
                }
                sprintf(desc, "Thumbnail for %s", uri);
-               IMB_imginfo_add_field(img, "Description", desc);
-               IMB_imginfo_add_field(img, "Software", "Blender");
-               IMB_imginfo_add_field(img, "Thumb::URI", uri);
-               IMB_imginfo_add_field(img, "Thumb::MTime", mtime);
+               IMB_imginfo_change_field(img, "Description", desc);
+               IMB_imginfo_change_field(img, "Software", "Blender");
+               IMB_imginfo_change_field(img, "Thumb::URI", uri);
+               IMB_imginfo_change_field(img, "Thumb::MTime", mtime);
                if (THB_SOURCE_IMAGE == source) {
-                       IMB_imginfo_add_field(img, "Thumb::Image::Width", cwidth);
-                       IMB_imginfo_add_field(img, "Thumb::Image::Height", cheight);
+                       IMB_imginfo_change_field(img, "Thumb::Image::Width", cwidth);
+                       IMB_imginfo_change_field(img, "Thumb::Image::Height", cheight);
                }
                img->ftype = PNG;
                img->depth = 32;