fuxs/teekesselchen — pull request #2 by SamSamFR (2013-08-06 23:46:22+00:00)
Title: fix major BUG : changeOrder can bump inferior photo to head. Plus: added...

... MPixel to the size comparison

the comparison between head and new, based on a sequence of parameters, should be lexicographical.
Only proceed to next if current parameters are found equal !
As it was, an inferior new photo could be bumped to head.
eg : image A is raw, but not rated. image B is a jpg export, rated 4 stars, and the rating option is set.
When this function analyses B, it does not enter the RAW comparison block, goes on, then compares superior to A in the RATING block.

more elegant solution would be to build a function (like act) from the activated options, which is then used to map photos to tuple (RAW, MPixels, size, ...), then use lexicographical order on that tuple.
But I've just started using Lua today to fix that plugin and I don't know how to do it that way, so I just added a plain boolean "continueOrder" ...

About MPixels : exporting a jpg to a smaller res can very well result in larger fileSize. On the other hand, one never upsamples a file when exporting. So using MPixels before fileSize is a good idea.