Hi,
I am preparing a new feature "multiple formats". It will give the ability to have several formats for a single photo. Let's give an example to make things clear.
You will be able to have photo "img1234.jpg" (original filename) and provide a TIF, CR2 (canon raw), EPS (photoshop) all 3 associated to the same photo. All formats will be available for download.
It sounds a bit like the pwg_representative feature but it's more powerful with these important differences:
1) Piwigo doesn't try to generate a representative, it is the user who provides the photo and the "multiple formats" with no specific server-side processing
2) the user can upload many formats for the same photo, not just one.
This feature will be very useful for providing RGB + CMYK + EPS + RAW of the same photo.
For now, I focus on the synchronization process (I will work on the API/web upload as a 2nd step). First I wanted to implement the same kind of filesystem as for pwg_representative, ie :
galleries album-test img1234.tif pwg_representative img1234.jpg
which would give:
galleries album-test img1234.jpg pwg_format img1234.tif img1234.cmyk.jpg img1234.eps img1234.cr2
The problem is that pwg_representative already have a bug that I don't feel fine with:
galleries album-test img1234.tif img1234.cr2 pwg_representative img1234.jpg
=> img1234.tif and img1234.cr2 have the same pwg_representative and if you delete img1234.cr2, it will delete pwg_representative/img1234.jpg and img1234.tif will lose its pwg_representative! Fixing this bug now is complicated because we would have to fix existing filenames...
One way to fix this problem, for the new multi-formats feature, would be:
galleries album-test img1234.jpg pwg_format img1234.jpg.tif img1234.jpg.cmyk.jpg img1234.jpg.eps img1234.jpg.cr2
=> we take the full filename before adding the format extension and not just the filename without extension. It is a constraint, since Canon/Nikon/Leica (and certainly all camera makers) are proving img1234.jpg+img1234.cr2 for Canon (or img1234.nef, for Nikon). It would mean we ask users to change filenames during the preparation.
On the other side, the issue exists only when you have several files with the same name without extension in the same folder. I don't remember any report about this problem on pwg_representative. Should I care about the same problem for multiple formats?
Offline
between renaming all files and renaming in case of a rare conflict which can be detected easily and which has been not reported yet, my point goes to the second one
Offline
I think we should not care about multiple formats and same file name...
It looks un-natural to have .jpg.cr2 ... Especially for the galleries part where file names form cameras could be used directly ...
Offline
OK. Thank you. I'm going to implement that "the simple way", which will make things easy for the majority of users.
Then I will have to think about "how to handle that in the API/web upload?". I think the important prerequisite will be to have first the basic photo, then the "formats": if Piwigo receives img1234.cr2 before img1234.jpg it won't be considered as a format, but as a non photo file which needs a representative...
Offline