The resource bundle and resource md5 sums.

Dmitry Kazakov dimula73 at gmail.com
Fri Jan 23 10:09:10 UTC 2015


Hi!

I'm afraid I don't understand the topic well enough, just a couple of
thoughts that might help:

1) MD5 must always be calculated on the static data. I don't know how we
ended up to calculate it on derived/interpreted data, but it really sounds
as a bug.
2) Dirty bits. Sometimes it is quite difficult to ensure consistency of
such bits. If we solve problem 1), can we avoid that?
3) For only-memory resources like Bg/Fg gradients it might be enough to
generate a default name for them and save real color values (current
colors). I guess that is exactly what the user expects to do.


So i think that for problem 3 we have three ways:
>
> 1) Either fix the classes to have only deterministic parts (but this might
> not be always possible given what the resource is and has to do) or
> calculate md5 on something that we are sure that it's not "interpreted"
> (but again this might no be fully possible if those parts doesn't change
> when the resource really change).
>
> 2) Implement a dirty bit in every resource and when creating bundles, if a
> resource that the user want to add to a bundle is modified, ask to the user
> which version of the two (original file, or the in memory modified version)
> he wants to add.
> So if the resource is unmodified the original file will be copied into the
> resource bundle (right now is saved instead), if it's modified the user
> will choose and the file will be saved into the resource bundle only if the
> user chooses the modified version.
> This way the md5 should be always calculated on the file, that is,
> afterall, the medium that can't change when given to others.
>
> 3) This is like solution 2 but without having to ask anything to the user.
> So for the case where the file is modified we automatically choose to use
> the modified version and to save it into the bundle.
>
> 2-3 Though do no solve the problem that arise when there's no original
> file, so when the resource is only in memory and it's representation can be
> different (when the resource is reloaded), from user to user. I think it's
> not solvable if not doing something like in point 1, or simply being sure
> to have files for everything.
>
> What do you all think?
>
> _______________________________________________
> Krita mailing list
> kimageshop at kde.org
> https://mail.kde.org/mailman/listinfo/kimageshop
>
>


-- 
Dmitry Kazakov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kimageshop/attachments/20150123/02a3159c/attachment.html>


More information about the kimageshop mailing list