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

Feature: Preview uploaded files in the editor #2232

Merged
merged 4 commits into from
Jul 18, 2023

Conversation

lindapaiste
Copy link
Collaborator

Fixes #57

Changes:

  • Creates an AssetPreview component which is rendered inside the editor container when the user clicks on a file with a url (that is, an asset uploaded to S3).
  • Gets the mime type from the file name using package mime (which we use on the server).
  • Handles the following mime types:
    • image/* => <img> element
    • video/* => <video> element
    • audio/* => <audio> element

I might need to tweak the CSS for images which are taller than they are wide. I'm using max-width: 100%; height: auto; for both image and video.

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #123

image
image
image

Copy link
Collaborator

@raclim raclim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really neat, thanks so much for working on this!

@raclim raclim merged commit 9bf6f4a into processing:develop Jul 18, 2023
@lindapaiste lindapaiste deleted the feature/asset branch August 8, 2023 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Different view for media files in editor
2 participants