-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Metadata api unsuable and lacking features #74
Comments
Hi @fredprodibi,
The final @jcupitt Is there any way to read EXIF values without this tail? I remembered we had the same problem in the test suite.
I personally think this is outside the scope of libvips. Can't you use exiftool for that purpose?
To check if the image contains an property of metadata you could use: var image = Image.NewFromFile("zebra.jpg", access: Enums.Access.Sequential);
if (image.Contains("exif-ifd0-Orientation"))
{
...
} |
From memory, the problem with exif data values is that they are typed. Each field (orientation, resolution, etc.) has an associated type (int, rational, etc.) and the string value must be reconstructible, ie. you have to be able to go exif binary data -> string -> exif binary data and get exactly the same thing in there. This means something like I suppose an alternative would be to add |
Another idea might be to output the EXIF tags in two forms, perhaps:
The |
Yes the issue is that if the user has some metadata that contains ( or ) it may return wrong results so it's not very robust.
Thank you :)
Yes I can that what I do right now but that means launching an additional process just to fetch the metadata, so the Get("xxx") looked has a good solution
Yes if it's not easier in libvips then we will have to go back to exiftool
That would help, but I think the best would be to output a class that will would give you
|
I m trying to extract metadata from the image attached, but the results from net-vips are not usable in a production environment and are lacking features to read metadata.
1. let's take the make exemple:
net-vips will return exif-ifd0-Make : "Canon (Canon, ASCII, 6 components, 6 bytes)"
so instead of Canon now we have to parse a string to extract the value.
if we have a user description he may have things like that : "My description (very good description)"
and net-vips will return something like "My description (very good description) (My description (very good description), ASCII, xx components, xx bytes)" that would be very difficult to parse reliably when the input is not controlled.
So the output should only be the value and if you want to output more details you need to return a structured object that will have something like value, components, length for example.
2. we cannot navigate or get things that are inside iptc or xmp
if we do Get("iptc-data") it returns a raw byte[] array that we don't know what to do with it, it should either be something navigable that we can continue query with GetFields or Get
I use this image to test
the expected result that is the one from exiftools is this one with the following command:
and this code to test:
`using var test1Image = Image.NewFromFile("libviptest.jpg");
the result of this is :
I think it would be easier if this api would allow for query with tag name like exiftool or at least with path, and may be provide a TryGet method so we can query if something exist or not without having to catch exceptions if not found. and the string output from the current implementation makes it completely unusable.
The text was updated successfully, but these errors were encountered: