Beep6581 / RawTherapee

A powerful cross-platform raw photo processing program
https://rawtherapee.com
GNU General Public License v3.0
2.81k stars 317 forks source link

Cache file based on canonical path of image (for symlinks) #5289

Open ronanM opened 5 years ago

ronanM commented 5 years ago

In my workflow I use many different symlinks to original images.

/path/to/originals/original_01.cr2
/path/to/originals/original_01.cr2.pp3
/some/path/link1_to_original_01.cr2
/some/path/link1_to_original_01.cr2.pp3

/another/path/link2_to_original_01.cr2
/another/path/link2_to_original_01.cr2.pp3

Rawtherapee will create a cache file for each file (original and symlinks).

Is it possible to create only one cache file for original and reuse it for all the symlinks targeting this original ?

See also: readlink --help

Hombre57 commented 5 years ago

@ronanM RT create an MD5 number of the canonical filename (including the whole path) to handle the case where the same file is located in different folder, so it's done by design.

ronanM commented 5 years ago

I'm not sure that's currently works like that.

I have lot of duplicate files (same content) in cache/images.

heckflosse commented 5 years ago

@ronanM It's done by design to have one cache file for each {path}/{image file} combination

ronanM commented 5 years ago

In my exemple I will have 3 files in cache/images not 1 (as needed).

heckflosse commented 5 years ago

With current code it's not possible.

heckflosse commented 5 years ago

Though the idea is interesting. I will have a look.

Hombre57 commented 5 years ago

@heckflosse Why would this idea be interesting ? On the contrary, the actual way let Linux users create multiple processing of the same file thanks to symlink. Do you really want to remove this collateral feature ?

ronanM commented 5 years ago

@Hombre57 In my use case .pp3 files are also linked, not only the image files.

With this trick, I've lot of links organized by combination of date/iso/panoramaSources/ranks/type/... with several orderings (workaround for #3317).

heckflosse commented 5 years ago

@Hombre57 It would reduce the amount of disk space needed to store the cache files in case you use symlinks.

heckflosse commented 5 years ago

@Hombre57

the actual way let Linux users create multiple processing of the same file thanks to symlink. Do you really want to remove this collateral feature ?

Not only Linux users. Symlinks also work on windows.

For sure I dont want to remove that feature. But the cache could be improved by not storing duplicate data.

heckflosse commented 5 years ago

@Hombre57 try this on windows:

1) copy a raw (foo.pef) into a folder c:\hombre 2) start cmd 3) cd to c:\hombre 4) call mklink foo1.pef foo.pef 5) Start RT and open folder c:\hombre 6) close RT 7) open Windows explorer 8) go to your RT-cache images folder

you will find two files with same content. One for foo.pef and another one for foo1.pef

That's what I want to improve: Only one cache file for both