Hi all, Dne Ätvrtek 14 Duben 2011 20:04:23 Omari Stephens napsal(a): > On 04/14/2011 05:39 PM, Colin Clark wrote: > > On 13/04/11 22:01, Colin Clark wrote: > >> On 10/04/11 17:51, stair wrote: > >>> I have recently starting using darktable for my raw processing and have > >>> come across a problem with the way geeqie groups darktable's xmp files, > >>> or rather doesn't, the files are not grouped > >>> > >>> when darktable creates it's sidecar files they are given the raw file > >>> full name including extension, in my case image.CR2, and adds the .xmp > >>> extension, so the sidecar is image.CR2.xmp.
This is not correct, according to xmp specification. I guess that other software will have problems with it too. > >>> > >>> The only way I can get grouping to work is to change the sidecar file > >>> name to eliminate the .CR2 bit but this is not a solution since it > >>> breaks the connection in darktable. Trying various things in the > >>> sidecar extensions list does not help > >>> > >>> I don't think I am missing something here, if so a pointer would be > >>> appreciated. If not then it would be very good if this could be fixed > >> > >> Hi > >> > >> I find that if I append ".CR2.xmp" to the sidecars extension list > >> (edit/preferences/preferences/files), then using right click on an image > >> set Disable File Grouping followed by Enable File Grouping - > >> > >> the .CR2.xmp files are then shown as grouped with the image. > >> > >> But this is not working correctly as the grouping is lost on re-start > >> and the file extensions of the sidecar files get corrupted when doing a > >> copy or move. > >> > >> So there is clearly a bug in this part of the code, but if this is > >> corrected it may be that you will get the functionality you are looking > >> for. > >> > >> Colin Clark > > > > Try changing line 761 of ui_fileops.c from > > > > return strrchr(path, '.'); > > > > to > > > > return strchr(path, '.'); > > > > > > I have no idea if that's a real solution to the problem - I'll have to > > leave that decision to someone who knows how Geeqie works. > > > > > > Colin Clark > > I'm pretty sure that's not actually correct; it'll fail on any file that > contains a period in the middle of the name. Dot in extensions is currently not supported and I don't think that the fix is trivial. > The Correct (though > probably a lot more computationally involved) solution is to consider a > file as having some sequence of zero or more extensions, starting at the > right edge of the filename. If you recognize the rightmost N portions > of that sequence, then you can identify the filetype. > > In practice, you can find the last segment (with strrchr), and if that's > ".xmp" or something, do it again and see if the next segment looks like > a recognizable file extension (".CR2" or somesuch). It seems reasonable > to only support two levels. How should the grouping work for files with two extensions then? > > --xsdg > The current algorithm for grouping is in filedata.c - function file_data_set_path() decides, which part of the path is the basename and which is the extension (but I think that some other parts of code expects strrchr(), this should be checked) - function file_data_check_sidecars() groups the files and decides which is the main file and which are sidecars - function filelist_read_real reads a directory and groups the files (through file_data_new_local() and file_data_check_sidecars()) - there is another code path for individually opened files (from commandline, drag&drop, etc.) - file_data_check_sidecars() calls check_case_insensitive_ext(). This code path is a problem for longer extensions and should be probably rewritten to use readdir too. Ideas for improvements or rewrite of the algorithm are welcome. Vladimir ------------------------------------------------------------------------------ Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev _______________________________________________ Geeqie-devel mailing list Geeqie-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geeqie-devel