UNPKG

1.6 kBtext/x-cView Raw
1// Copyright 2013 Lovell Fuller and others.
2// SPDX-License-Identifier: Apache-2.0
3
4#ifndef SRC_METADATA_H_
5#define SRC_METADATA_H_
6
7#include <string>
8#include <napi.h>
9
10#include "./common.h"
11
12struct MetadataBaton {
13 // Input
14 sharp::InputDescriptor *input;
15 // Output
16 std::string format;
17 int width;
18 int height;
19 std::string space;
20 int channels;
21 std::string depth;
22 int density;
23 std::string chromaSubsampling;
24 bool isProgressive;
25 int paletteBitDepth;
26 int pages;
27 int pageHeight;
28 int loop;
29 std::vector<int> delay;
30 int pagePrimary;
31 std::string compression;
32 std::string resolutionUnit;
33 std::string formatMagick;
34 std::vector<std::pair<int, int>> levels;
35 int subifds;
36 std::vector<double> background;
37 bool hasProfile;
38 bool hasAlpha;
39 int orientation;
40 char *exif;
41 size_t exifLength;
42 char *icc;
43 size_t iccLength;
44 char *iptc;
45 size_t iptcLength;
46 char *xmp;
47 size_t xmpLength;
48 char *tifftagPhotoshop;
49 size_t tifftagPhotoshopLength;
50 std::string err;
51
52 MetadataBaton():
53 input(nullptr),
54 width(0),
55 height(0),
56 channels(0),
57 density(0),
58 isProgressive(false),
59 paletteBitDepth(0),
60 pages(0),
61 pageHeight(0),
62 loop(-1),
63 pagePrimary(-1),
64 subifds(0),
65 hasProfile(false),
66 hasAlpha(false),
67 orientation(0),
68 exif(nullptr),
69 exifLength(0),
70 icc(nullptr),
71 iccLength(0),
72 iptc(nullptr),
73 iptcLength(0),
74 xmp(nullptr),
75 xmpLength(0),
76 tifftagPhotoshop(nullptr),
77 tifftagPhotoshopLength(0) {}
78};
79
80Napi::Value metadata(const Napi::CallbackInfo& info);
81
82#endif // SRC_METADATA_H_