-
Notifications
You must be signed in to change notification settings - Fork 4
dimensions in refKeys and refresh task #134
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unhappy with this. We can add width and height to the preset of refkeys, but trying to refresh the dimensions on each refresh is a waste of resources:
a) Files are static, a file can never change inside the blobstore (so it's dimensions can't neither)
b) These are set on upload. If it didn't work then i can't see a reason why it should work now.
c) Refresh is not only called when you rebuild a searchIndex but also when updating inbound relations.
If you have valid images that didn't have them set they are either veeery old or we have a bug in there (and should investigate that instead)
Hello @tsteinruecken, |
I don't like turning on readOnly mode on width and height. When uploading images, we are using blobstore.fetch_data() and image.Image to get us the dimensions. But when you are using big images in terms of filesize >=1 MiB we'll hit a hard resource limit and this codepath will raise. But there are scenarios where external programs can provide this information later or as metadata in kwargs, so it would still be nice to be able to set them via fromClient() |
Good morning @skoegl, I can understand your objection, but in first place it is correct and valid that the user shall not be able to change these values. Readonly bones can still be set and overridden by custom functions within the module or by a customized, exposed function not using fromClient() to be called by external programs. |
It would be nice and sometimes necessary to get the dimensions of an image.
So I added width and height to refkeys of fileBone and update the dimensions on refresh from blobstore.