File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
src/components/ContactDetails Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -309,12 +309,20 @@ export default {
309309 */
310310 getMimetype (uint ) {
311311 const bytes = []
312- uint .slice (0 , 4 ).forEach ((byte ) => {
313- bytes .push (byte .toString (16 ))
312+ uint .slice (0 , 12 ).forEach ((byte ) => {
313+ bytes .push (byte .toString (16 ). padStart ( 2 , ' 0 ' ) )
314314 })
315315 const hex = bytes .join (' ' ).toUpperCase ()
316316
317- switch (hex) {
317+ const nextcloudMajorVersion = parseInt (window .OC .config .version .split (' .' )[0 ])
318+ if (nextcloudMajorVersion >= 31
319+ && hex .slice (0 , 8 ) === ' 52494646'
320+ && hex .slice (16 , 24 ) === ' 57454250'
321+ ) {
322+ return ' image/webp'
323+ }
324+
325+ switch (hex .slice (0 , 8 )) {
318326 case ' 89504E47' :
319327 return ' image/png'
320328 case ' 47494638' :
You can’t perform that action at this time.
0 commit comments