OpenXLSX 1.12.1
Modern C++ Excel Library (Fork of OpenXLSX by Kenneth Troldal Balslev)
Loading...
Searching...
No Matches
XLImageParser.hpp
Go to the documentation of this file.
1/*
2 * OpenXLSX-NX - Modern High-Performance C++ Excel Library
3 *
4 * Original work Copyright (c) 2018-2025, Kenneth Troldal Balslev and OpenXLSX contributors
5 * Modified work Copyright (c) 2026, Curry Tang and OpenXLSX-NX contributors
6 *
7 * Distributed under the BSD 3-Clause License.
8 * See LICENSE.md in the project root or https://opensource.org/licenses/BSD-3-Clause
9 */
10
11#ifndef OPENXLSX_XLIMAGEPARSER_HPP
12#define OPENXLSX_XLIMAGEPARSER_HPP
13
14#include "OpenXLSX-Exports.hpp"
15#include <cstdint>
16#include <string>
17
18#include <gsl/span>
19
20namespace OpenXLSX
21{
22
24 {
25 uint32_t width{0};
26 uint32_t height{0};
27 std::string extension{""};
28 bool valid{false};
29 };
30
34 class OPENXLSX_EXPORT XLImageParser
35 {
36 public:
37 static XLImageSize parseDimensions(const std::string& path);
38 static XLImageSize parseDimensions(gsl::span<const uint8_t> data);
39 };
40
41} // namespace OpenXLSX
42
43#endif // OPENXLSX_XLIMAGEPARSER_HPP
Parses binary image headers (PNG, JPG, GIF) to extract width and height without external dependencies...
Definition XLImageParser.hpp:35
static XLImageSize parseDimensions(const std::string &path)
Definition XLImageParser.cpp:19
Definition IXLCellProvider.hpp:24
Definition XLImageParser.hpp:24
uint32_t width
Definition XLImageParser.hpp:25
std::string extension
Definition XLImageParser.hpp:27
uint32_t height
Definition XLImageParser.hpp:26
bool valid
Definition XLImageParser.hpp:28