Closed ashwani-rathee closed 2 years ago
Feel free to add new images to TestImages.jl.
Couple of things to cover in next commit:
Also if possible:
Getting permission for some more test images from libexif team: https://github.com/libexif/libexif/issues/88 I tested mnote functionality on https://github.com/libexif/libexif/blob/master/test/testdata/canon_makernote_variant_1.jpg and it works
julia> a = read_tags(filepath1; read_all=true,read_mnote=true)
Dict{String, Any} with 105 entries:
"MNOTE_FLASH_EXPOSURE_COMPENSATION" => "0.00 EV"
"MNOTE_SELF-TIMER" => "Off"
"MNOTE_FOCUS_RANGE" => "Auto"
"MNOTE_FOCAL_PLANE_X_SIZE" => "7.39 mm"
"MNOTE_EXPOSURE_COMPENSATION" => "0.00 EV"
"EXIF_TAG_SENSING_METHOD" => "One-chip color area sensor"
"MNOTE_EASY_SHOOTING_MODE" => "Landscape"
⋮ => ⋮
And yes we have their permission now!
Not entirely sure why the segmentation faults are happening now tbh, sometimes I am able to read all the maker note tags from those new test images(https://github.com/ashwani-rathee/exif-sampleimages) but sometimes it all just starts failing. But I think it comes from here when reading the maker note tags, also I have seen the mnote tags fail in tests but they generally seem to work in repl.
mnote = LibExif.exif_mnote_data_get_name(md_ptr, i) # so it give a pointer to location of name of tag but i am unable to
# decide how far to read so its like [83,100,91,63,0,120...] and we have mnote which is address of 83,
# so ideallly we should have size of name, so we just read till 0 and then convert it to UInt8 and then to string
if (mnote == C_NULL) continue end
data = unsafe_wrap(Array, mnote, 30) # but given we don't have size of name(haven't been able to find it), i read 30 address which might
# not the smart thing to do, haven't been able to find the size of name in documentation
Or I am missing some understanding of resources management, freeing pointers or something like that
Also, I think its best if we remove fixformat for now, there are some conspicous errors showing up there too.
@ashwani-rathee I think this PR is almost finished, can you try to finish the unresolved comments so that we can merge it (for GSoC evaluation purposes)?
@ashwani-rathee nice work!
This will include read operations on tags like:
Focus:
tags.jl need to export all tags which it doesn't yet and need to decide on the names(IMAGE-WIDTH still looks long and maybe there is a better way to do it), there are some issue with clang.jl wrapper generation that needs a fix so I use a old version from here: https://github.com/ashwani-rathee/io-project/blob/main/exifviewer/gen/LibExif.jl Also need to check if we have some image availabe in testimages.jl for testing purpose or do I need to include it?
Able to do: