Mattermost-server: Show TIF image thumbnail previews

Created on 11 Jan 2018  路  17Comments  路  Source: mattermost/mattermost-server

If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.

New contributors please see our Developer's Guide, specifically for machine setup and for developer workflow.


Notes: Jira ticket

Currently .tif images are shown as generic attachment thumbnails. This ticket is to show the image preview in the thumbnail similar to other images (eg JPG).

Current TIF image thumbnail:
image

Current JPG thumbnail:
image

AreEnd User Feature Easy Help Wanted PR Exists TecGo TecReactJS

Most helpful comment

Interesting. I'm not sure what would cause that error specifically, but it's good to know that that fixed it. If *.tif is a common file extension, it might be worth looking into fixing that later on, but for now, I think it's fine to move on with only supporting *.tiff since I assume it's the more common option.

All 17 comments

@jasonblais vl give it a try!!

Great, thank you @pruthvip!

@jasonblais I tried it. But there is a server side error coming

Unable to decode image err=tiff: unsupported feature: compression value 7
[2018/02/03 15:14:17 IST] [DEBG] GET - /api/v4/files/rjox7zfijpgm9r4tgg87b5zxbw/thumbnail [2018/02/03 15:14:17 IST] [EROR] /api/v4/files/rjox7zfijpgm9r4tgg87b5zxbw/thumbnail:ReadFile code=404 rid=ex1utx9kffbmdnm6g14x6shbqa uid=aw9uf5whxpr97kuncmmd6kbyew ip=::1 Encountered an error reading from local server storage [details: open data/20180203/teams/noteam/channels/dzfuw1k7wtffbxam8mtsaxp5gc/users/aw9uf5whxpr97kuncmmd6kbyew/rjox7zfijpgm9r4tgg87b5zxbw/AMC_Pressbilder_BYAIH_thumb.jpg: no such file or directory]

Looks like GO is not able to generate thumbnails for tiff image. I dont have much knowledge of GO. Hence I needed some help with this

@pruthvip looks like Go doesn鈥檛 support that compression type yet (https://github.com/golang/go/issues/23115). I would try your code with other tiffs, and if it works for at least some of them, we can merge it and add support for that compression type in a follow-up PR (and maybe submit it to Go as well).

Making this available for the public again as there hasn't been updates for some month.

Hi @hanzei sorry for the lack of updates while working on this! I'm a little embarrassed, but I had some trouble with the local environment a few times. I also didn't expect to work as much on the golang server as much because the label said reactjs and the go label had been removed, but I'm rather new to golang and found that it's been a little more work than what's been suggested here in the Jira ticket. That's also is partly what's been taking me longer than expected. Would I still be able to continue working on this ticket?

Hi @ejachang,

sorry for misleadingly removing the go label. It would be great, if you continue your work on this ticket!
Do you need help to set up your dev environment? Do you still have questions about this ticket?

Hi @hanzei ,

I'm good for now on my dev environment! I was experiencing problems with running make commands related to this, but it was solved. The other error was fixed with an update.

I don't have any questions right now on this ticket, but will definitely let you know! Thank you so much!

Hi @hanzei,
I'm having a little trouble decoding the tiff, but not sure if I am accessing the tiff data correctly? I understand the file data stream is from Input io.Reader, but I get the following message when I try to decode using the tiff package from t.Input and find the decoded tiff image is nil.
{"level":"error","ts":1546586445.681277,"caller":"app/file.go:735","msg":"Unable to decode image err=unexpected EOF"}

I'm still looking into this and am thinking it is something to do with what I am passing into tiff.Decode. When I try to see the data from t.Input it seems to be pretty short. An example I see is: {0xc001e3e810} Is there something I might be missing?

I'm not familiar with this part of the codebase. @hmhealey could you please help?

Hi @ejachang. How are you uploading the file? Is it just using the web app? It seems like either the data that you're using is bad or there's something preventing all of the data from being loaded

Hi @hmhealey. Yes, I'm uploading just using the web app. I think I found the issue - I was using a tiff file with *.tif, and that seems to have caused the problem. It worked fine when I used a file with *.tiff. I'm not sure if golang supports the *.tif, but should I move forward with it working for *.tiff for now?

Interesting. I'm not sure what would cause that error specifically, but it's good to know that that fixed it. If *.tif is a common file extension, it might be worth looking into fixing that later on, but for now, I think it's fine to move on with only supporting *.tiff since I assume it's the more common option.

Hi @hanzei - I'm still working on the webapp part of the solution for this ticket, but was not sure if additional help is still needed since the Help Wanted label was added?

Hey @ejachang! We updated our Help Wanted issues by removing [Help Wanted] from the issue title and instead include it as a label. No new work/help is needed from what you're already working on.

Thanks for all your help on this issue! It's much appreciated :)

Oh, got it @jasonblais ! Thanks for the clarification.

Was this page helpful?
0 / 5 - 0 ratings