Skip to content

V4.0.0 beta release #13

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

Closed
wants to merge 117 commits into from
Closed

Conversation

Xentraxx
Copy link

@Xentraxx Xentraxx commented Apr 25, 2025

4.0.0-wacheee (by Xentraxx)

Fork/Alternate version

This change is a big overhaul of the project, so only the major improvements or potential breaking changes are mentioned

Tl;dr

  • Added support for reading EXIF data from JXL (JPEG XL), ARW, RAW, DNG, CRW, CR3, NRW, NEF and RAF files internally.
  • Adeded support for reading and writing coordinates and DateTime from and to exif for almost all file formats.
  • Added a "--write-exif" flag which will write missing EXIF information (coordinates and DateTime) from json to EXIF for jpg and jpeg files
  • Added support to get DateTime from .MOV, .MP4 and probably many other video formats through exiftool. You need to download it yourself (e.g. from here: https://exiftool.org/), rename it to exiftool.exe and make sure the folder you keep it in is in your $PATH variable or in the same folder as gpth.
  • Added verbose mode (--verbose or -v)
  • File size is not limited anymore by default but can be limited using the --limit-filesize flag for systems with low RAM (like a NAS).

General improvements

  • upgraded dependencies and fixed breaking changes
  • updated dart to a minimum version of 3.8.0 of the dart SDK
  • included image, intl and coordinate_converter packages
  • applied a list of coding best practices through lint rules to code
  • added/edited a bunch of comments and changed unnecessary print() to log() for debugging and a better user experience
  • Divided code in steps through comments and included steps in output for readability, debuggability and to make it easier to follow the code
  • checked TODOs in README.md
  • Added TODOs to look into in code through //TODO comments
  • moved json_extractor file into date_extractor folder
  • added unit tests for new write-exif functionality
  • made CLI --help output more readable through line breaks
  • renamed some variables/functions to better reflect their purpose
  • moved step 8 (update creation time) before final output
  • added output how often DateTime and Coordinates have been written in EXIF at the final output
  • changed that test data will be created in test subfolder instead of project root directory
  • Added consistent log levels to log output to quickly differenciate between informational and error logs
  • Added logging of elapsed time for each step.
  • Exposed the maxFileSize flag as an argument (--limit-filesize) to set if necessary, It's now deactivated by default to support larger files like videos.
  • Added DateTime extraction method statistics to the final output - shows how many files had their dates extracted through which method
  • Added elapsed time logging for each processing step

Bug fixes

  • fixed existing unit tests which would fail on windows

Added functionality

  • Support for writing coordinates and DateTime to EXIF

    • Added new CLI option "--write-exif".
    • When enabled, the script will check if the associated json of any given file contains coordinates and if the file does not yet have them in its EXIF data, the script will add them.
    • When enabled, the script will check if a DateTime has been extracted from any of the given extraction methods and if the file has no EXIF DateTime set, it will add the DateTime to the EXIF data 'DateTime', 'DateTimeOriginal'and 'DateTimeDigitized'.
    • Added verbose mode (--verbose or -v) with log levels info, warning and error.
  • Moved from the stale "exif" package to "exif_reader" for dart local exif reading, the image library for local jpeg exif writing and the external exiftool for all other EXIF reading and writing (images and videos)

    • The move to exif_reader adds support for extracting DateTime from JXL (JPEG XL), ARW, RAW, DNG, CRW, CR3, NRW, NEF and RAF files, and video formats like MOV, MP4, etc.
    • Exiftool needs to be in $PATH variable or in the same folder as the running binary. If not, that's okay. Then we fall back to exif_reader. But if you have ExifTool locally, Google Photos Takeout Helper now supports reading CreatedDateTime EXIF data for almost all media formats.
  • Added new interactive prompts:

    • Option to write EXIF data to files (--write-exif)
    • Option to limit file size for systems with low RAM (--limit-filesize)
Previous fixes and improvement (from 3.4.3-wacheee to 4.0.0-wacheee)
Limitations:
  • if album mode is set to duplicate-copy, it will move the album photos to the album folder (as usual), but ALL_PHOTOS will not contain them if the media is not in a year album.
  • it does not fix issues related to reading JSON files (if necessary) for Motion Photo files; however, if the dates are included in the file name (as with Pixel Motion Photos), the correct dates will be established.
  • No interactive unzipping

Xentraxx added 28 commits April 23, 2025 10:18
bumped version and fixed breaking changes
Pull request in deprecated repo is pending. It makes sense to include it locally to be able to bump version of ffi and win32.
Working on the TODOs next.
Can now write coordinates and DateTime in exif data for:
JPG, PNG / Animated APNG, GIF / Animated GIF, BMP, TIFF, TGA and PVR.
See changelog.
code is very slow. working on it.
did hide new experimental slow functrionality behind "write-exif" flag
Added steps, so it's easier to debug.
Added another step and the steps to more output
added tests and better error handling.
Also moved the date_extractor type definition in the date_extractor folder and added a FillingBar for the removeDuplicates operation for better user experience.
Next commit will be fixes for lint
Applied best practices to code
…t end

Want to have overview at end what happened to better how much a flag/a new version fixed. Also changed a print() to log()
Updated Changelog, project version, bumped dart min SDK version and minor changes to output.
This is a release candidate.
Please test and provide feedback.
the lookupMimeType() did give back "tif" for tiff and null for tga. Fixed by just looking at the extension of path instead file type.
The Exif_reader package is a fork of the exif package which is maintained.
… .mp4 through ffprobe

ffprobe has to be manually downloaded and needs to be present in $PATH variable. Updated changelog.
Release candidate 2.
Made some significant changes to support more file formats.
group.dart was just changed because of lint rule. Otherwise just changed and added some logs and comments to catch more edge cases during debuging and get better log messages on what is happening.
@Xentraxx
Copy link
Author

@jaimetur https://github.com/Xentraxx/GooglePhotosTakeoutHelper/releases/tag/v4.0.0
Now the binaries are smaller when generated through the githiub workflow. No idea why.

Xentraxx added 3 commits May 26, 2025 10:23
Rename Albums and Files with Emojis once in the beginning and rename them back at the end instead of creating temporary directories.
This is more efficient and solves multiple Problems (can use PowerShell again for symlinks)
@jaimetur
Copy link

jaimetur commented May 26, 2025

@jaimetur https://github.com/Xentraxx/GooglePhotosTakeoutHelper/releases/tag/v4.0.0 Now the binaries are smaller when generated through the githiub workflow. No idea why.

That's good. For linux i guess is only amd64 (x86) version right? what about arm64? with GitHub actions is easy to generate binaries for both, also for macOS (arm64 and amd64).

I put here how I have my GitHub Actions to build binaries for the whole OS/Architectures (excluding windows-arm64 that not exists):

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest] # os list
arch: [x86_64, arm64] # arch list
exclude:
- os: windows-latest
arch: arm64 # Windows is only compiled for x86 (32/64-bit)

runs-on: ${{ matrix.os }}

Xentraxx added 5 commits May 26, 2025 16:47
…exception

Basically we now decode them at the beginning, rename the folder, then do everything on that folder without any emojis and all the way at the end, we encode the emoji again and rename the folder back.
Also exchanged createShortcutWin back to PS to saveguard against heap exception because now emojis are no problem anymore.
@Wacheee
Copy link
Owner

Wacheee commented May 26, 2025

Hey, sorry for not responding, I was on vacation. I can see that a lot happened. I tried your last version and it worked great!

I also compared the time it takes for the program to move files (and create shortcuts) in version 3.6.2 versus 4.0.0 (Windows).

3.6.2
image

4.0.0
image

4.0.0 uses PowerShell, and it takes six times longer (66 vs 426 secs) to create shortcuts because PowerShell is pretty slow for that.

I will try to see if there is a way to improve the function using ffi/win32 without causing a heap exc

@Xentraxx
Copy link
Author

Xentraxx commented May 26, 2025

@Wacheee No worries :)
Yeah if you find a way to use ffi/win32 without causing a heap exc, that would definitely be preferable!
I am now creating the final release of 4.0.0.
Just checking the changelog again, maybe adding some more tests, but logic wise I won't change anything anymore.
New features can be included in 4.0.1.
I created a branch for 4.0.1 to do the last bugfixes.

You can download 4.0.0 here: https://github.com/Xentraxx/GooglePhotosTakeoutHelper/actions/runs/15260465559

@Xentraxx Xentraxx closed this May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants