-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show warning if TIFF #54
base: master
Are you sure you want to change the base?
Conversation
I noticed that the message is still displayed even after removing all .tiff files. Is that the way it should be? (Just asking) |
I wanted that it is not displayed anymore. |
You can request a review from Martin when you're done. |
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 mostly good so far! Did you look into whether the actual TIFF size could be checked via JS, too? You probably need a JS package to read TIFFs for this. Then we could show an actual error that prevents users from uploading too small files.
If checking the TIFF locally is too complicated then we can keep the current implementation.
src/resources/views/create.blade.php
Outdated
@@ -190,6 +190,10 @@ class="btn btn-success" | |||
Spaces in the file and directory names were replaced by underscores. | |||
</p> | |||
|
|||
<p v-cloak v-if="hasTIFFfile" class="text-warning"> | |||
Only large TIFF files (10,000+ px) are supported. Smaller files may not work. |
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.
This must use the config value: {{config('images.threshold')}}
.
src/resources/views/create.blade.php
Outdated
@@ -190,6 +190,10 @@ class="btn btn-success" | |||
Spaces in the file and directory names were replaced by underscores. | |||
</p> | |||
|
|||
<p v-cloak v-if="hasTIFFfile" class="text-warning"> | |||
Only large TIFF files (10,000+ px) are supported. Smaller files may not work. |
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.
Also:
Only large TIFF files (10,000+ px) are supported. Smaller files may not work. | |
Only large TIFF files (10,000+ px) are supported. Smaller files cannot be displayed. |
I looked into some options. One is the UTIF.js library, which can extract the width and height of a TIFF file. The tiff file must first be read as an ArrayBuffer, which is then decoded using UTIF.decode(). This provides metadata, including image dimensions. However, UTIF.js does not support compressed TIFFs (such as JPEG or ZIP-compressed files, not scure if this is needed). Another option is TIFF.js, which works similarly but is slower because of fully decoding TIFF image. |
So TIFF.js also works with compressed images? Is it as fast as UTIF.js with non-compressed images? Can you please provide a minimal example code that loads a TIFF and extracts the dimensions for both libraries? I'd like to test them on a 40 GB TIFF we have in BIIGLE. The utif package seems to be dubious as it is not maintained by the developer. We could use the utif2 package which also claims to support JPEG compressed images. Or we tell NPM to install the package from source. |
This update introduces a warning message when a user adds a TIFF file to the upload list and closes #22