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

Preview not taking mime-type into account but only file extension #2919

Closed
ssendev opened this issue Jul 1, 2023 · 5 comments · Fixed by #2930
Closed

Preview not taking mime-type into account but only file extension #2919

ssendev opened this issue Jul 1, 2023 · 5 comments · Fixed by #2930
Assignees
Labels
community javascript Pull requests that update Javascript code UI User Interface

Comments

@ssendev
Copy link

ssendev commented Jul 1, 2023

The preview at the right only works if the file name ends in .png or another image extension if it has no extension the preview is disabled.

Expected Behavior

Enable the preview button if a compatible mime type is set

Current Behavior

The prieview button is disabled even if an image mime type is set

Steps to Reproduce (for bugs)

  1. upload an image with a key of foo.png
  2. upload the same image with a key of foo and set the mime type to image/png
  3. see that foo.png has a the preview while foo has not

Context

The correct mime type is listed at the bottom and is also returned when generating a share url.

Your Environment

  • Version used (minio --version): RELEASE.2023-06-29T05-12-28Z (commit-id=aae684641325e1c37375d455c790e58d902bd7b6)
  • Server setup and configuration: Docker
@harshavardhana
Copy link
Member

The reason we do that is because to know content-type we have to spend an additional API call on the object.

We want things to be simple. Preview itself is good to have functionality not a fundamental feature here.

What you are asking goes beyond this and making its scope larger. Just name the file appropriately, it is human friendly and useful for everyone.

@ssendev
Copy link
Author

ssendev commented Jul 1, 2023

Apparently this is the wrong repository and searching in the right one turned up it's a duplicate #2573

@ssendev
Copy link
Author

ssendev commented Jul 1, 2023

to know content-type we have to spend an additional API call on the object.

But the correct content type is already displayed so no api call is needed.

Screenshot from 2023-07-01 18-55-53

@harshavardhana harshavardhana transferred this issue from minio/minio Jul 2, 2023
@harshavardhana
Copy link
Member

In that case we can provide preview.

@harshavardhana harshavardhana reopened this Jul 2, 2023
@prakashsvmx prakashsvmx self-assigned this Jul 10, 2023
@prakashsvmx prakashsvmx added UI User Interface javascript Pull requests that update Javascript code labels Jul 10, 2023
@prakashsvmx
Copy link
Member

Thank you @ssendev . for the supported preview types, we will also add Content-Type based preview along with extension based preview.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community javascript Pull requests that update Javascript code UI User Interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants