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

initial support for special HEIF metadata #271

Merged
merged 2 commits into from
Jul 27, 2024

Conversation

bigcat88
Copy link
Owner

@bigcat88 bigcat88 commented Jul 26, 2024

Read Only support for some part of data from this issue: #234

def test_pillow_read_heif_metadata():
    im = Image.open("images/heif_other/spatial_photo.heic")
    assert "heif" in im.info
    assert im.info["heif"]["camera_intrinsic_matrix"] == {
        "focal_length_x": 1525.444598197937,
        "focal_length_y": 1525.444598197937,
        "principal_point_x": 1280.0,
        "principal_point_y": 1280.0,
        "skew": 0.0,
    }
    assert im.info["heif"]["camera_extrinsic_matrix_rot"] == (1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0)

So far I've managed to do reading and only for two fields.

Although libehif added a low-level API for reading of everything?, it's still in beta, so this is the only way I've managed to do it for now.

Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
@bigcat88 bigcat88 force-pushed the feat/heif-camera_intrinsic_matrix branch from 91fe62c to ee3b5ad Compare July 26, 2024 20:37
Copy link

codecov bot commented Jul 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (48a9760) to head (661d39d).

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #271   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines          936       952   +16     
=========================================
+ Hits           936       952   +16     
Files Coverage Δ
pillow_heif/_version.py 100.00% <100.00%> (ø)
pillow_heif/heif.py 100.00% <100.00%> (ø)
pillow_heif/misc.py 100.00% <100.00%> (ø)

Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
@bigcat88 bigcat88 merged commit b7cc751 into master Jul 27, 2024
28 checks passed
@bigcat88 bigcat88 deleted the feat/heif-camera_intrinsic_matrix branch July 27, 2024 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant