immich-go icon indicating copy to clipboard operation
immich-go copied to clipboard

[FEATURE REQUEST] FastFoto scanned image stack option

Open isaacolsen94 opened this issue 2 years ago • 18 comments

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 avatar Apr 01 '24 17:04 isaacolsen94

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}

isaacolsen94 avatar Apr 01 '24 17:04 isaacolsen94

Thanks for the suggestion. Added to the todo list

simulot avatar Apr 01 '24 17:04 simulot

Awesome, thank you so much!

isaacolsen94 avatar Apr 01 '24 23:04 isaacolsen94

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?

isaacolsen94 avatar Jun 15 '24 18:06 isaacolsen94

I'm focused on fixing bugs at the moment

simulot avatar Jun 16 '24 08:06 simulot

Hey! Sorry to bug about this again, but saw you asking about feature requests in the latest release comments. So I thought I'd ping this again. Tha ka for the awesome work you do!

isaacolsen94 avatar Oct 14 '24 00:10 isaacolsen94

That's the right moment to pop up your request!

simulot avatar Oct 14 '24 06:10 simulot

Could provide a non personal scan to illustrate the case? I would like to check what are EXIF fields Thnks

simulot avatar Nov 01 '24 15:11 simulot

Yes, I had to do a google drive link because I didn't have any scans small enough to upload here. Here is the link: https://drive.google.com/drive/folders/1RGZl8f1Yxg7uOFfux_V3DEXmevBuvktN?usp=sharing

isaacolsen94 avatar Nov 01 '24 16:11 isaacolsen94

Received, thank you. Which one you want as cover for the stack?

simulot avatar Nov 01 '24 17:11 simulot

The _a version

isaacolsen94 avatar Nov 01 '24 17:11 isaacolsen94

👀 image

image

simulot avatar Nov 01 '24 21:11 simulot

That looks absolutely amazing! Thank you so much!! That will save me hours of manually stacking!!

isaacolsen94 avatar Nov 01 '24 23:11 isaacolsen94

The feature is available in the alpha 4 release https://github.com/simulot/immich-go/releases/tag/v0.23.0-alpha4

simulot avatar Nov 07 '24 09:11 simulot

Hey, first off want to thank you for this feature!! It has saved me DAYs of work! I did notice a slight bug though. It works flawlessly except it seems on files with parentheses in the name. Example: Stack fine: 1992-xx-xx - Easter_Arizona_0069.jpg 1992-xx-xx - Easter_Arizona_0069_a.jpg 1992-xx-xx - Easter_Arizona_0069_b.jpg

Don't stack (but do upload): 1992-xx-xx - Easter_Arizona - 0069.jpg 1992-xx-xx - Easter_Arizona - 0069_a.jpg 1992-xx-xx - Easter_Arizona - 0069_b.jpg

Don't stack (but do upload): 1992-xx-xx - Easter_Arizona (FF-680W-1200-PR) - 0069.jpg 1992-xx-xx - Easter_Arizona (FF-680W-1200-PR) - 0069_a.jpg 1992-xx-xx - Easter_Arizona (FF-680W-1200-PR) - 0069_b.jpg

isaacolsen94 avatar Feb 14 '25 21:02 isaacolsen94

That's my fate: there is always one more bug ;-)

simulot avatar Feb 14 '25 21:02 simulot

I did see that RC release and felt bad throwing this one up :P I did a bit more digging and it seems to be less the parentheses and more the space before the 0000 numbers at the end

isaacolsen94 avatar Feb 14 '25 21:02 isaacolsen94

The name pattern recognition is a little bit too strict, requiring a _ followed by digits then a or b and the extension.

I'm interesting in how the files are generated, which part is given by the user, and which is given by the scan software. Can I relax the rule, and simply say that file names always finish by 4 digits then the extension or _a or _b and the extension?

simulot avatar Feb 15 '25 07:02 simulot