Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pr/1035'
Browse files Browse the repository at this point in the history
  • Loading branch information
hanatos committed Nov 16, 2015
2 parents 53a5385 + 6a56c0c commit b281c39
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
12 changes: 7 additions & 5 deletions src/common/exif.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1057,14 +1057,16 @@ int dt_exif_write_blob(uint8_t *blob, uint32_t size, const char *path, const int
Exiv2::ExifData blobExifData;
Exiv2::ExifParser::decode(blobExifData, blob + 6, size);
Exiv2::ExifData::const_iterator end = blobExifData.end();
Exiv2::ExifData::iterator it;
for(Exiv2::ExifData::const_iterator i = blobExifData.begin(); i != end; ++i)
{
// add() does not override! we need to delete existing key first.
Exiv2::ExifKey key(i->key());
if(imgExifData.findKey(key) == imgExifData.end())
imgExifData.add(Exiv2::ExifKey(i->key()), &i->value());
if((it = imgExifData.findKey(key)) != imgExifData.end()) imgExifData.erase(it);

imgExifData.add(Exiv2::ExifKey(i->key()), &i->value());
}
// Remove thumbnail
Exiv2::ExifData::iterator it;
if((it = imgExifData.findKey(Exiv2::ExifKey("Exif.Thumbnail.Compression"))) != imgExifData.end())
imgExifData.erase(it);
if((it = imgExifData.findKey(Exiv2::ExifKey("Exif.Thumbnail.XResolution"))) != imgExifData.end())
Expand Down Expand Up @@ -1114,8 +1116,6 @@ int dt_exif_read_blob(uint8_t *buf, const char *path, const int imgid, const int
assert(image.get() != 0);
image->readMetadata();
Exiv2::ExifData &exifData = image->exifData();
// needs to be reset, even in dng mode, as the buffers are flipped during raw import
exifData["Exif.Image.Orientation"] = uint16_t(1);

// get rid of thumbnails
Exiv2::ExifThumb(exifData).erase();
Expand Down Expand Up @@ -1154,6 +1154,8 @@ int dt_exif_read_blob(uint8_t *buf, const char *path, const int imgid, const int
{
/* Delete various MakerNote fields only applicable to the raw file */

exifData["Exif.Image.Orientation"] = uint16_t(1);

// Canon color space info
if((pos = exifData.findKey(Exiv2::ExifKey("Exif.Canon.ColorSpace"))) != exifData.end())
exifData.erase(pos);
Expand Down
7 changes: 5 additions & 2 deletions src/common/imageio.c
Original file line number Diff line number Diff line change
Expand Up @@ -663,13 +663,16 @@ int dt_imageio_export_with_flags(const uint32_t imgid, const char *filename,
buf.pre_monochrome_demosaiced);
dt_dev_pixelpipe_create_nodes(&pipe, &dev);
dt_dev_pixelpipe_synch_all(&pipe, &dev);
dt_dev_pixelpipe_get_dimensions(&pipe, &dev, pipe.iwidth, pipe.iheight, &pipe.processed_width,
&pipe.processed_height);

if(filter)
{
if(!strncmp(filter, "pre:", 4)) dt_dev_pixelpipe_disable_after(&pipe, filter + 4);
if(!strncmp(filter, "post:", 5)) dt_dev_pixelpipe_disable_before(&pipe, filter + 5);
}

dt_dev_pixelpipe_get_dimensions(&pipe, &dev, pipe.iwidth, pipe.iheight, &pipe.processed_width,
&pipe.processed_height);

dt_show_times(&start, "[export] creating pixelpipe", NULL);

// find output color profile for this image:
Expand Down

0 comments on commit b281c39

Please sign in to comment.