simulot / immich-go

An alternative to the immich-CLI command that doesn't depend on nodejs installation. It tries its best for importing google photos takeout archives.
GNU Affero General Public License v3.0
1.2k stars 36 forks source link

[FEATURE REQUEST] FastFoto scanned image stack option #213

Open isaacolsen94 opened 3 months ago

isaacolsen94 commented 3 months ago

Hey it would be lovely to have the script stack Epson's FastFoto scanned output files. Currently if you scan a photo it can output 3 files, the original scan, a "corrected" scan, and the backside of the photo if it has writing on it. Its structure looks like this: specified-image-name.jpg Original specified-image-name_a.jpg Corrected specified-image-name_b.jpg Back of Photo

Would it be possible to have the script make the original the top photo and stack the _a/_b files behind it?

isaacolsen94 commented 3 months ago

I played around with codespace and chatgpt and got something similar to what you have that would stack photos that ended in _a and _b, but I really don't know much about programming, but thought I'd paste it here incase it helps, but I know chatgpt is rarely useful for these kind of tasks.

var fastFotoRE = regexp.MustCompile(`^(.*)(_a|_b)(\..*)$`)

func fastFoto(name string) (bool, string, bool) {
    parts := fastFotoRE.FindStringSubmatch(name)
    if len(parts) == 0 {
        return false, "", false
    }
    base := strings.TrimSuffix(parts[1], "_a")
    base = strings.TrimSuffix(base, "_b")
    return true, base, false // Assume fastFoto files are not cover
}

var stackMatchers = []stackMatcher{nexusBurst, huaweiBurst, pixelBurst, samsungBurst, fastFoto}
simulot commented 3 months ago

Thanks for the suggestion. Added to the todo list

isaacolsen94 commented 3 months ago

Awesome, thank you so much!

isaacolsen94 commented 3 weeks ago

Hey Simulot, first thanks for all the awesome work you've put into this! I just wanted to follow up and see if this was still on your radar?

simulot commented 3 weeks ago

I'm focused on fixing bugs at the moment