rosalina saige
@catgirl
she/her
it/its
trans catgirl
πŸ’– sponsor me! quirks about me
disorders!!
autism
adhd
Nintendo Switch presence Splashcat stats

learning rust to extract and modify image gps coordinates from images

hiya!! recently i started learning rust for my albums project (i'll post about this Soonℒ️) and i figured i'd write about it here :3

trying to learn for like, the 4th time

i've already made a few other attempts with learning rust and i've never gotten very far in doing that :( this time i started with the rust book. i went through chapters 1-4 of it and at that point felt slightly comfortable with moving on to actually trying to make something. i still didn't really know what i was doing at this point though... i kinda just guessed my way through the rest of it and that was fun!

image_info

i was learning all this for my image_info thing!! it's a little rust program that takes in a file path and a location privacy. for some context, image_info gets called by lune using process.spawn. it prints to stdout a json object containing the image's datetime, gps coordinates, and all of it's exif data unformatted.

{
  "location_latitude": 0,
  "location_longitude": 0,
  "location_altitude": 0,
  "date_time": "2024-04-22T06:47:40Z",
  "exif_data": {
    "some": "tags"
  }
}

it also reduces the precision of the gps coordinates in the file for the publicly served image. this is pretty much all image_info does, the rest of it all happens in luau which i will write about later :3

for crates i brought in rexiv2 and serde. i found rexiv2 when looking for libraries that do exif data things. there were a few but rexiv2 seemed like the best one.

anyways, i'm kinda out of things to say. i'm still not really sure how to write blog posts. or if anyone reads these lol. kinda fun to do though :3 just, aaaaa don't know how :(

posted
0 likes
1 repost
0 bookmarks
did you write a response to this? send a webmention!
0 replies
Other Mentions