Skip to content
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

Unsupported image files fail to generate thumbnails (tif) #1048

Open
ehawman-rosenberg opened this issue Dec 15, 2021 · 1 comment · May be fixed by #1051
Open

Unsupported image files fail to generate thumbnails (tif) #1048

ehawman-rosenberg opened this issue Dec 15, 2021 · 1 comment · May be fixed by #1051

Comments

@ehawman-rosenberg
Copy link
Contributor

Just tested on r1335. Uploaded a tif, assigned it to a test client, looked at the "View my files" page and the preview looks like this

image

Inspecting the source shows that a URL is being generated

<img src="https://rosenberg-library.org/filesend/upload/thumbnails/thumb_a28ffc586d2a871842a4af62ea4959ed_50x50.tif" class="thumbnail" alt="Test Tif .tif">

However, no file appears inside /upload/thumbnails.

It sounds like tifs are compatible but something is broken. If they aren't, we should probably just have no preview. Also, I'm not sure what handles the thumbnail generation but I think it should recognize when an expected file hasn't been generated and fail into no preview.

@ehawman-rosenberg
Copy link
Contributor Author

ehawman-rosenberg commented Dec 16, 2021

I had some time so I poked around for the thumbnail generator. The function isImage is correctly identifying TIF as an image but claviska/simpleimage doesn't appear to support TIF files.

I see that in setEmbeddableType you are relying on isImage() to give files the greenlight, so any image format that isn't supported by simpleimage is waved through. On my branch I changed it to

        // Image
        $embeddable = ["gif", "jpeg", "png", "webp", "bmp", "svg"];
        if (isImage($this->full_path) && in_array($this->extension, $embeddable)) {
            $this->embeddable = true;
            $this->embeddable_type = 'image';
        }

However, this didn't stop the broken URLs from being generated and appearing, so something else must be up. It seems that sometimes we check for $file->embeddable and sometimes we don't. I tried poking at it and shattered everything so I'm gonna back off for now. I might take another look when I have some time.

@ehawman-rosenberg ehawman-rosenberg changed the title tif Files Not Generating Thumbnails Unsupported image files fail to generate thumbnails (tif) Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant