mirror of
https://github.com/Xevion/phototag.git
synced 2025-12-06 05:15:52 -06:00
remove LEARNING add to-do section to README
This commit is contained in:
49
LEARNING.md
49
LEARNING.md
@@ -1,49 +0,0 @@
|
||||
# photo-tagging
|
||||
|
||||
## First Objectives
|
||||
|
||||
This project really was an experience, I'll not ever deny that.
|
||||
|
||||
My first goal was to basically be able to read and image, upload to Google and receive back labels.
|
||||
This was accomplished very quickly, and the next step was either learning how to parse the weird `.XMP` files I had found in the folder.
|
||||
I did not understand them and why they were detached from the `.NEF`, and only later did I learn later that only `RAW` format files use this XMP file, which I only recently learned was called a `Sidecar file` in filesystems.
|
||||
|
||||
I started off with trying to parse, read, and write tags to and from an XMP file quickly. I had much trouble with this, as I could not find a working (Windows) Python module for `XMP` parsing fast enough, as the only one available required `exempi`, which was not officially supported for Windows at the time. To this date, I still have not figured out how I could have gone about it. Please message me if you know how, I'd still love to see if Exempi had what I was looking for.
|
||||
|
||||
I even tried an `XML` parser, but after learning that it was in fact a `XML` parser, I dropped it, oblivious to the fact that `XML` is essentially `XMP`.
|
||||
|
||||
After a long while of unsuccessful searches on the subject, I gave up and looked into how I could do it myself - with minimal effort...
|
||||
|
||||
*I turned to Regex.*
|
||||
|
||||
Surprisingly, Regex worked pretty well, and added tags without problem 99% of the time. However, I would only learn a long while after that there were serious caveats to what I was doing here.
|
||||
|
||||
After "successfully" figuring out XMP parsing, I moved onto making a proper package and drew of a plan for how I could parse files. This one took a while since I'd never done image resizing or anything with input/output of files on this kind of scale (small scale) before.
|
||||
|
||||
After a couple of hours, I had a working prototype which took files, compressed, uploaded to Google for labelling, and received a set of labels while keeping processing/uploading times at a minimum. It was rather speedy for what I could expect, at around 0.5 images a second.
|
||||
|
||||
The real punch in the gut comes now - Time to implement that actual tagging operation. I learned here that only `.NEF` files carried the `.XMP` sidecar file, and had to split up my tagging operation into IPTC tagging and XMP based tagging, and I had to think about the complex file enviroment I would need to parse - What if two files had the same name, different extension, and one was a `.NEF` with a `.XMP` sidecar file? Does the `.NEF` get priority? Do we quit? Do we give an alert? What happens here?
|
||||
|
||||
I also had to think about turning this application into a commandline utility for quickly tagging all the photos on my machine - Would it overwrite files in place? What happens if my utility goes haywire? Would I be storing backups of the `.XMP` files? What happens when it's a heavily modified `.XMP` file, those can get very large!
|
||||
|
||||
## Working with XMP Sidecar files
|
||||
|
||||
Before I could even think about all that, I had to verify that I could work with `.XMP` files in the first place, as my current setup using Regex was failing when it came down to adding tags to something that has never been tagged before. Worse yet, I had and still have no idea what most of the stuff present in a `.XMP` file means, so it was clear that I had to resort to something with true XMP read and write capabilities.
|
||||
|
||||
Shortly after my failure to get `py3exiv2` working, as well as a second try at getting `exempi` working using `msys2`, I decided to ask StackOverflow, and that's when I first saw the mention of a `sidecar file`, and `XML`.
|
||||
|
||||
Yup, I finally realized that XMP == XML. The only difference was that XMP had a couple more tags and used namespaces for all the custom tags.
|
||||
|
||||
With this, I instantly bolted for XML parsing modules and got to work figuring out how I could best parse and navigate the XML module. Within hours, and after a long ass sleep, I got a working read and writing keywords setup that should be sustainable enough for my purposes.
|
||||
|
||||
## Final legs on the first release of the project
|
||||
|
||||
With reading and writing out of the way, all that was left for the module was to simply write the reading and writing commands up, and fix the module up so someone could actually understand what was going on.
|
||||
|
||||
These were pretty easy to do, but I've gotten unusually doing anything but my project lately, so I've been kinda slow at actually figuring it out.
|
||||
|
||||
The project from here is essentially in a state where it either needs to be split up into multiple sections to be truly useful and fast to the end user.
|
||||
|
||||
One such method would be a commandline utility, invoked by something like `phototag -R ./` which would **`R`**`ecursively` tag everything in the folder and below it.
|
||||
|
||||
For now, I leave the project at this state.
|
||||
12
README.md
12
README.md
@@ -38,8 +38,12 @@ The command used to access this program is `phototag run`, which would process a
|
||||
* Full support for NEF only, it is assumed but not tested whether or not CR2 and other formats will behave the same.
|
||||
* Requires a existing XMP file to be available
|
||||
|
||||
## Creation
|
||||
## To-do
|
||||
|
||||
I've typed up a file with everything I've learned about XMP files, Adobe, and just how complex this problem really was for me.
|
||||
|
||||
[./LEARNING.md](./LEARNING.md)
|
||||
* Implement async or parallel processing
|
||||
* Move to more precise logging system
|
||||
* Test with different RAW file formats
|
||||
* Stress test use with Adobe sidecar files
|
||||
* Make more robust configuration file system
|
||||
* Integration with click CLI
|
||||
* Better, to-the-point logging
|
||||
|
||||
Reference in New Issue
Block a user