summaryrefslogtreecommitdiff
path: root/vcl/source/filter/GraphicFormatDetector.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/filter/GraphicFormatDetector.cxx')
-rw-r--r--vcl/source/filter/GraphicFormatDetector.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/vcl/source/filter/GraphicFormatDetector.cxx b/vcl/source/filter/GraphicFormatDetector.cxx
index 56f7a9f2d006..162125f3fe97 100644
--- a/vcl/source/filter/GraphicFormatDetector.cxx
+++ b/vcl/source/filter/GraphicFormatDetector.cxx
@@ -28,6 +28,7 @@
namespace vcl
{
+
namespace
{
bool isPCT(SvStream& rStream, sal_uLong nStreamPos, sal_uLong nStreamLen)
@@ -545,6 +546,18 @@ bool GraphicFormatDetector::checkPDF()
return false;
}
+bool GraphicFormatDetector::checkWEBP()
+{
+ if (maFirstBytes[0] == 'R' && maFirstBytes[1] == 'I' && maFirstBytes[2] == 'F'
+ && maFirstBytes[3] == 'F' && maFirstBytes[8] == 'W' && maFirstBytes[9] == 'E'
+ && maFirstBytes[10] == 'B' && maFirstBytes[11] == 'P')
+ {
+ msDetectedFormat = "WEBP";
+ return true;
+ }
+ return false;
+}
+
} // vcl namespace
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */