[Digikam-devel] Adjusting filters to be deterministic

Marcel Wiesweg marcel.wiesweg at gmx.de
Thu Jun 17 17:52:20 BST 2010


> > 1) Which filters are affected? A search for rand reveals:
> > - BlurFX
> > - DistortionFX
> > - Filmgrain
> 
> Filmgrain is already deterministic I think.

Yes, it is using a constant seed. Nonetheless, the algorithm is not defined.


> For Digikam we don't need 1 in fact on the contrary we want a
> deterministic sequence of random numbers.
> 
> For this why not just use a constant as seed initialized at the start of
> the filter, for instance the constant 1 ?
> 
> srand(1)
> 
> By the way in digikam code there are macro to use different version of
> randr depending if we are on windows or not, we could use the rand
> fonctio provided by qt.

In the docs of Qt, there is no documentation that the function is fixed and 
not platform-dependent.

> 
> Another point related to non destructive editing: I think a md5sum of
> the intermediate pictures should be stored in the database, when a
> picture is recomputed this would allows Digikam to detect if some
> algorithm has changed and warn the user that the result may be different
> from what he saw in the first place.

The hash method works very well for example for text files, if you look at 
git. But it breaks for us: We modify image data, and we modify metadata. So 
we'd need a hash only over the image data. But this is not easily available at 
the moment.



More information about the Digikam-devel mailing list