Alex Chan, a software developer, writes about Git, personal archiving, static sites, macOS tools, and small programming problems.
Commenters admire the site's look and link its practical posts on webarchive files, SQLite copying, and working with large S3 objects.
> I think that all "photos" or "videos" are just a view of the underlying "photo or video object". If you crop a video, the full-size video will remain. Only if you export the video, it will be cropped and the smaller file size will manifest.
Yup, the Photos app keeps the unmodified original file, and then any edits/crops are stored separately. You can always revert to the original file and redo your edits. So they might be storing multiple copies of the same image, with and without edits.
Which API were you looking at for "file size"?
I was able to get the size data from Photos.app with the PhotoKit API [1]. I've only tested it with my library of ~26k items, but it was useful for getting an indicator of the biggest items. (Although I didn't think to check whether exporting a 1GB video caused my iCloud usage to drop by 1GB.)
[1]: https://alexwlchan.net/2023/finding-big-photos/
I encourage everyone to read A Plumber's Guide to Git: https://alexwlchan.net/a-plumbers-guide-to-git/
It's not a book, just a series of five short blog posts. Part 1 explains precisely where files live: https://alexwlchan.net/a-plumbers-guide-to-git/1-the-git-object-store/
$ mkdir animals
$ cd animals
$ git init
$ echo "Big blue basilisks bawl in the basement" > animals.txt
$ git hash-object -w animals.txt
b13311e04762c322493e8562e6ce145a899ce570
$ find .git/objects -type f
.git/objects/b1/3311e04762c322493e8562e6ce145a899ce570
$ rm animals.txt
$ git cat-file -p b13311e04762c322493e8562e6ce145a899ce570 > animals.txt
Congratulations, you just did a `git restore animals.txt` manually.
Parts 2 through 5 are equally illuminating.
Removing drm from .azw3 is easy. [0] All you need is the ID of your kindle, since it's tied to your device.
There is also a plugin for Calibre, although I haven't tested this myself. I'm not sure if it requires a device ID or not. [1]
[0]: https://alexwlchan.net/2019/08/removing-the-drm-from-my-kindle-books/
[1]: https://github.com/apprenticeharper/DeDRM_tools/wiki/Exactly-how-to-remove-DRM
The author considered the proprietary nature of the webarchive format, and determined that it was readable without Apple software, and that it wouldn't be too difficult to create a tool to view or transform webarchive files if Safari were to disappear: https://alexwlchan.net/til/2024/whats-inside-safari-webarchive/
Of course, without a working implementation, there could be hidden obstacles.
As it turns out, I have been having fun with the plumbers guide to git [0]. While it's not a book, it is a way to understand the inner workings of Git . Think of it as first principles. The book "Pro Git" linked by @kgodey has a few chapters related to this "plumbing" [1]
[0]https://alexwlchan.net/a-plumbers-guide-to-git/
[1] https://git-scm.com/book/en/v2/Git-Internals-Git-Objects
This was a twitter thread, so not too surprising, but the concluding tweet went there too: "Good error messages explain what’s gone wrong, and give clear instructions for what to do next – and being cutesy rarely helps." and there's a link to https://alexwlchan.net/2020/10/the-importance-of-good-error-messages as the dedicated writeup (also from tweets) for that specific point.