mirror of
https://github.com/ONLYOFFICE/server.git
synced 2026-04-07 14:04:35 +08:00
[bug] Fix getImageFormatBySignature for svg
This commit is contained in:
@ -37,7 +37,8 @@ var constants = require('./constants');
|
||||
|
||||
function getImageFormatBySignature(buffer) {
|
||||
var length = buffer.length;
|
||||
var startText = buffer.toString('ascii', 0, 100);
|
||||
//1000 for svg(xml header and creator comment)
|
||||
var startText = buffer.toString('ascii', 0, 1000);
|
||||
|
||||
//jpeg
|
||||
// Hex: FF D8 FF
|
||||
@ -187,6 +188,7 @@ function getImageFormatBySignature(buffer) {
|
||||
}
|
||||
|
||||
//svg
|
||||
//todo sax parser
|
||||
if (-1 !== startText.indexOf('<svg')) {
|
||||
return constants.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_SVG;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user