File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -46,8 +46,21 @@ defmodule ExImageInfo.Types.HEIF do
46
46
if length ( ispe_boxes ) > 0 do
47
47
{ width , height } =
48
48
ispe_boxes
49
- |> Enum . map ( fn << _ :: size ( 32 ) , width :: size ( 32 ) , height :: size ( 32 ) , _rest :: binary >> ->
50
- { width , height }
49
+ |> Enum . map ( fn << _ :: size ( 32 ) , width :: size ( 32 ) , height :: size ( 32 ) , rest :: binary >> ->
50
+ [ _ispe | clap ] = String . split ( rest , "clap" )
51
+
52
+ if length ( clap ) > 0 do
53
+ << clap_width_n :: size ( 32 ) , clap_width_d :: size ( 32 ) , clap_height_n :: size ( 32 ) ,
54
+ clap_height_d :: size ( 32 ) , _horizontal_offset_n :: size ( 32 ) ,
55
+ _horizontal_offset_d :: size ( 32 ) , _vertical_offset_n :: size ( 32 ) ,
56
+ _vertical_offset_d :: size ( 32 ) , _rest :: binary >> = List . first ( clap )
57
+
58
+ clap_width = round ( clap_width_n / clap_width_d )
59
+ clap_height = round ( clap_height_n / clap_height_d )
60
+ { clap_width , clap_height }
61
+ else
62
+ { width , height }
63
+ end
51
64
end )
52
65
|> Enum . max_by ( & elem ( & 1 , 0 ) )
53
66
You can’t perform that action at this time.
0 commit comments