Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXIF IDF pointer #1923

Merged
merged 9 commits into from
Jan 9, 2022
Merged

Conversation

IldarKhayrutdinov
Copy link
Contributor

@IldarKhayrutdinov IldarKhayrutdinov commented Jan 4, 2022

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

Fixes for #1921

@IldarKhayrutdinov IldarKhayrutdinov marked this pull request as ready for review January 4, 2022 13:59
@codecov
Copy link

codecov bot commented Jan 4, 2022

Codecov Report

Merging #1923 (92cc9fb) into master (a54a19f) will increase coverage by 0%.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1923   +/-   ##
======================================
  Coverage      88%     88%           
======================================
  Files         966     966           
  Lines       51353   51350    -3     
  Branches     6402    6401    -1     
======================================
+ Hits        45217   45218    +1     
+ Misses       5076    5074    -2     
+ Partials     1060    1058    -2     
Flag Coverage Δ
unittests 88% <100%> (+<1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...rc/ImageSharp/Metadata/Profiles/Exif/ExifWriter.cs 91% <100%> (+2%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a54a19f...92cc9fb. Read the comment docs.

@antonfirsov
Copy link
Member

Can we add a test case based on the #1921 repro steps?

@IldarKhayrutdinov
Copy link
Contributor Author

@antonfirsov of course it would be nice to add a test to check 4 zeros at the end

@JimBobSquarePants JimBobSquarePants added this to the 2.0.0 milestone Jan 5, 2022
@IldarKhayrutdinov
Copy link
Contributor Author

I needs to additional reviewing of EXIF writer methods, it seems there are problems of IFD writing (regarding next IFD pointers and gps sub IFD). Next IFD pointer should be written after each IFD, but at the moment it's written only after the last IFD.

@IldarKhayrutdinov IldarKhayrutdinov marked this pull request as draft January 5, 2022 14:05
@IldarKhayrutdinov IldarKhayrutdinov marked this pull request as ready for review January 8, 2022 11:51

int i = 0;

// The byte order marker for little-endian, followed by the number 42 and a 0
ExifConstants.LittleEndianByteOrderMarker.CopyTo(result.AsSpan(start: i));
i += ExifConstants.LittleEndianByteOrderMarker.Length;

uint ifdOffset = ((uint)i - startIndex) + 4U;
uint thumbnailOffset = ifdOffset + ifdLength + exifLength + gpsLength;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in fact, the thumbnail isn't written, this is an unnecessary line

Copy link
Member

@JimBobSquarePants JimBobSquarePants left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Thanks for stepping up 👍

@JimBobSquarePants JimBobSquarePants merged commit ce34e84 into SixLabors:master Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants