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

Fix default previews #950

Merged
merged 1 commit into from
Jan 7, 2022
Merged

Fix default previews #950

merged 1 commit into from
Jan 7, 2022

Conversation

st3iny
Copy link
Member

@st3iny st3iny commented Jan 7, 2022

Fix #909

Some default preview SVGs are not shown correctly because they are imported using the wrong loader. In some places (ref #842) this has already been fixed.

I changed some webpack rules to force the usage of raw-loader for all SVGs to bypass the !raw-loader!... hack. This is needed because they are inserted using v-html and the default loader (asset/inline) from our shared config produces data:image/svg+xml blobs.

PS: The attribute xlink:href is deprecated in favor of just href (ref https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/xlink:href).

Illustrations (still working) Default previews (now fixed)
Screenshot 2022-01-07 at 10-36-58 Photos - Nextcloud Screenshot 2022-01-07 at 10-36-49 Photos - Nextcloud

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
@st3iny st3iny added bug Something isn't working 3. to review Waiting for reviews labels Jan 7, 2022
@st3iny st3iny added this to the Nextcloud 24 milestone Jan 7, 2022
@st3iny st3iny requested review from juliusknorr and skjnldsv January 7, 2022 09:41
@st3iny st3iny self-assigned this Jan 7, 2022
@@ -29,6 +29,15 @@ webpackRules.RULE_SCSS.use = [
},
]

// Load raw SVGs to be able to inject them via v-html
webpackRules.RULE_ASSETS.test = /\.(png|jpe?g|gif|woff2?|eot|ttf)$/
webpackRules.RULE_RAW_SVGS = {
Copy link
Member

Choose a reason for hiding this comment

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

Fancy 😍
Love that we can do that and it stays clean!

@skjnldsv skjnldsv merged commit ff8db83 into master Jan 7, 2022
@skjnldsv skjnldsv deleted the fix/909/default-preview-svgs branch January 7, 2022 10:29
@st3iny
Copy link
Member Author

st3iny commented Jan 7, 2022

/backport to stable23

@backportbot-nextcloud backportbot-nextcloud bot added the backport-request Pending backport by the backport-bot label Jan 7, 2022
@st3iny
Copy link
Member Author

st3iny commented Jan 7, 2022

/backport to stable22

@st3iny
Copy link
Member Author

st3iny commented Jan 7, 2022

/backport to stable21

@backportbot-nextcloud
Copy link

The backport to stable23 failed. Please do this backport manually.

@backportbot-nextcloud
Copy link

The backport to stable22 failed. Please do this backport manually.

@backportbot-nextcloud
Copy link

The backport to stable21 failed. Please do this backport manually.

st3iny added a commit that referenced this pull request Jan 7, 2022
Backport of #950

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
st3iny added a commit that referenced this pull request Jan 7, 2022
Backport of #950

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews backport-request Pending backport by the backport-bot bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No default thumbnail for video files when preview provider for video files is not enabled
2 participants