-
-
Notifications
You must be signed in to change notification settings - Fork 272
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
How to set GPS related exif tags? #674
Comments
Found it, will open a fork and send a PR with the changes. (I'll keep the issue open until then) For anyone in dire need see the methods below: bool get hasGPSLatitude => data.containsKey(0x0002);
double? get gpsLatitude => data[0x0002]?.toDouble();
set gpsLatitude(double? value) {
if (value == null) {
data.remove(0x0002);
} else {
data[0x0002] = IfdValueDouble(value);
}
}
bool get hasGPSLongitude => data.containsKey(0x0004);
double? get gpsLongitude => data[0x0004]?.toDouble();
set gpsLongitude(double? value) {
if (value == null) {
data.remove(0x0004);
} else {
data[0x0004] = IfdValueDouble(value);
}
}
Just add them to the ifd_directory.dart and you should be good |
See #677 for the PR |
For those of you who tries to change coords it is:
|
If anyone need also to chage GPS times here is code like @Flajt made bool get hasGPSDate => data.containsKey(0x001D);
String? get gpsDate => data[0x001D]?.toString();
set gpsDate(String? value) {
if (value == null) {
data.remove(0x001D);
} else {
data[0x001D] = IfdValueAscii(value);
}
} |
Hello, I have expanded upon your code as it wasn't fully complete, please consider updating your submitted PR.
The longitude and latitude cannot be negative, and the refs must be included as these are responsible for the polar directions. I have encoded a jpeg image, and uploaded this and you can see the location is correct (previously it was incorrect taking me to a location in Belgium). For reference see exiftool to understand EXIF standards and EXIF information. Hope this helps! |
Thanks both of you, I'll update it this week. Will post here as soon as its done. |
So after nearly forgetting it, I've added the changes, just need to check if it works, bc I did it on the fly in the github editor. |
PR has been merged, I'll close this |
Hello, first of all, a nice package for the exif-related parts of images (I'm dying to try and save a small amount of data).
I want to save a
GPSLongitude
&GPSLatitude
tag in my jpg file.However, I can't get it to work:
I tried:
The
GPSOffset
is being calculated an added, but not my Coordinates : /Here a the map containg the data that is added (I anonymized some stuff):
The
gpsIfd
is just empty.I've considered forking and extending the setters like
userComment
etc. but idk if that would resolve it. Since I'm not yet 100% understanding the codebase.The text was updated successfully, but these errors were encountered: