Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
e249bc3e
Commit
e249bc3e
authored
Jul 16, 2017
by
Wescoeur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(QExifImageHeader): use app indentation
parent
8d46bcb1
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1305 additions
and
1440 deletions
+1305
-1440
QExifImageHeader.cpp
src/utils/QExifImageHeader.cpp
+1047
-1170
QExifImageHeader.h
src/utils/QExifImageHeader.h
+258
-270
No files found.
src/utils/QExifImageHeader.cpp
View file @
e249bc3e
This diff is collapsed.
Click to expand it.
src/utils/QExifImageHeader.h
View file @
e249bc3e
...
...
@@ -51,19 +51,14 @@
#include <QSysInfo>
#include <QIODevice>
typedef
QPair
<
quint32
,
quint32
>
QExifURational
;
typedef
QPair
<
qint32
,
qint32
>
QExifSRational
;
//Q_DECLARE_METATYPE(QExifURational)
//Q_DECLARE_METATYPE(QExifSRational)
typedef
QPair
<
quint32
,
quint32
>
QExifURational
;
typedef
QPair
<
qint32
,
qint32
>
QExifSRational
;
class
QExifValuePrivate
;
class
QExifValue
{
class
QExifValue
{
public:
enum
Type
{
enum
Type
{
Byte
=
1
,
Ascii
=
2
,
Short
=
3
,
...
...
@@ -74,8 +69,7 @@ public:
SignedRational
=
10
};
enum
TextEncoding
{
enum
TextEncoding
{
NoEncoding
,
AsciiEncoding
,
JisEncoding
,
...
...
@@ -83,66 +77,64 @@ public:
UndefinedEncoding
};
QExifValue
();
QExifValue
(
quint8
value
);
QExifValue
(
const
QVector
<
quint8
>
&
value
);
QExifValue
(
const
QString
&
value
,
TextEncoding
encoding
=
NoEncoding
);
QExifValue
(
quint16
value
);
QExifValue
(
const
QVector
<
quint16
>
&
value
);
QExifValue
(
quint32
value
);
QExifValue
(
const
QVector
<
quint32
>
&
value
);
QExifValue
(
const
QExifURational
&
value
);
QExifValue
(
const
QVector
<
QExifURational
>
&
value
);
QExifValue
(
const
QByteArray
&
value
);
QExifValue
(
qint32
value
);
QExifValue
(
const
QVector
<
qint32
>
&
value
);
QExifValue
(
const
QExifSRational
&
value
);
QExifValue
(
const
QVector
<
QExifSRational
>
&
value
);
QExifValue
(
const
QDateTime
&
value
);
QExifValue
(
const
QExifValue
&
other
);
QExifValue
&
operator
=
(
const
QExifValue
&
other
);
~
QExifValue
();
bool
operator
==
(
const
QExifValue
&
other
)
const
;
bool
isNull
()
const
;
int
type
()
const
;
int
count
()
const
;
TextEncoding
encoding
()
const
;
quint8
toByte
()
const
;
QVector
<
quint8
>
toByteVector
()
const
;
QString
toString
()
const
;
quint16
toShort
()
const
;
QVector
<
quint16
>
toShortVector
()
const
;
quint32
toLong
()
const
;
QVector
<
quint32
>
toLongVector
()
const
;
QExifURational
toRational
()
const
;
QVector
<
QExifURational
>
toRationalVector
()
const
;
QByteArray
toByteArray
()
const
;
qint32
toSignedLong
()
const
;
QVector
<
qint32
>
toSignedLongVector
()
const
;
QExifSRational
toSignedRational
()
const
;
QVector
<
QExifSRational
>
toSignedRationalVector
()
const
;
QDateTime
toDateTime
()
const
;
QExifValue
();
QExifValue
(
quint8
value
);
QExifValue
(
const
QVector
<
quint8
>
&
value
);
QExifValue
(
const
QString
&
value
,
TextEncoding
encoding
=
NoEncoding
);
QExifValue
(
quint16
value
);
QExifValue
(
const
QVector
<
quint16
>
&
value
);
QExifValue
(
quint32
value
);
QExifValue
(
const
QVector
<
quint32
>
&
value
);
QExifValue
(
const
QExifURational
&
value
);
QExifValue
(
const
QVector
<
QExifURational
>
&
value
);
QExifValue
(
const
QByteArray
&
value
);
QExifValue
(
qint32
value
);
QExifValue
(
const
QVector
<
qint32
>
&
value
);
QExifValue
(
const
QExifSRational
&
value
);
QExifValue
(
const
QVector
<
QExifSRational
>
&
value
);
QExifValue
(
const
QDateTime
&
value
);
QExifValue
(
const
QExifValue
&
other
);
QExifValue
&
operator
=
(
const
QExifValue
&
other
);
~
QExifValue
();
bool
operator
==
(
const
QExifValue
&
other
)
const
;
bool
isNull
()
const
;
int
type
()
const
;
int
count
()
const
;
TextEncoding
encoding
()
const
;
quint8
toByte
()
const
;
QVector
<
quint8
>
toByteVector
()
const
;
QString
toString
()
const
;
quint16
toShort
()
const
;
QVector
<
quint16
>
toShortVector
()
const
;
quint32
toLong
()
const
;
QVector
<
quint32
>
toLongVector
()
const
;
QExifURational
toRational
()
const
;
QVector
<
QExifURational
>
toRationalVector
()
const
;
QByteArray
toByteArray
()
const
;
qint32
toSignedLong
()
const
;
QVector
<
qint32
>
toSignedLongVector
()
const
;
QExifSRational
toSignedRational
()
const
;
QVector
<
QExifSRational
>
toSignedRationalVector
()
const
;
QDateTime
toDateTime
()
const
;
private:
QExplicitlySharedDataPointer
<
QExifValuePrivate
>
d
;
QExplicitlySharedDataPointer
<
QExifValuePrivate
>
d
;
};
struct
ExifIfdHeader
;
class
QExifImageHeaderPrivate
;
class
QExifImageHeader
{
class
QExifImageHeader
{
Q_DISABLE_COPY
(
QExifImageHeader
)
public:
enum
ImageTag
{
public:
enum
ImageTag
{
ImageWidth
=
0x0100
,
ImageLength
=
0x0101
,
BitsPerSample
=
0x0102
,
...
...
@@ -172,8 +164,7 @@ public:
Copyright
=
0x8298
};
enum
ExifExtendedTag
{
enum
ExifExtendedTag
{
ExifVersion
=
0x9000
,
FlashPixVersion
=
0xA000
,
ColorSpace
=
0xA001
,
...
...
@@ -190,7 +181,6 @@ public:
SubSecTimeOriginal
=
0x9291
,
SubSecTimeDigitized
=
0x9292
,
ImageUniqueId
=
0xA420
,
ExposureTime
=
0x829A
,
FNumber
=
0x829D
,
ExposureProgram
=
0x8822
,
...
...
@@ -233,8 +223,7 @@ public:
SubjectDistanceRange
=
0x40C
};
enum
GpsTag
{
enum
GpsTag
{
GpsVersionId
=
0x0000
,
GpsLatitudeRef
=
0x0001
,
GpsLatitude
=
0x0002
,
...
...
@@ -268,50 +257,49 @@ public:
GpsDifferential
=
0x001E
};
QExifImageHeader
();
explicit
QExifImageHeader
(
const
QString
&
fileName
);
~
QExifImageHeader
();
QExifImageHeader
();
explicit
QExifImageHeader
(
const
QString
&
fileName
);
~
QExifImageHeader
();
bool
loadFromJpeg
(
const
QString
&
fileName
);
bool
loadFromJpeg
(
QIODevice
*
device
);
bool
saveToJpeg
(
const
QString
&
fileName
)
const
;
bool
saveToJpeg
(
QIODevice
*
device
)
const
;
bool
loadFromJpeg
(
const
QString
&
fileName
);
bool
loadFromJpeg
(
QIODevice
*
device
);
bool
saveToJpeg
(
const
QString
&
fileName
)
const
;
bool
saveToJpeg
(
QIODevice
*
device
)
const
;
bool
read
(
QIODevice
*
device
);
qint64
write
(
QIODevice
*
device
)
const
;
bool
read
(
QIODevice
*
device
);
qint64
write
(
QIODevice
*
device
)
const
;
qint64
size
()
const
;
qint64
size
()
const
;
QSysInfo
::
Endian
byteOrder
()
const
;
QSysInfo
::
Endian
byteOrder
()
const
;
void
clear
();
void
clear
();
QList
<
ImageTag
>
imageTags
()
const
;
QList
<
ExifExtendedTag
>
extendedTags
()
const
;
QList
<
GpsTag
>
gpsTags
()
const
;
QList
<
ImageTag
>
imageTags
()
const
;
QList
<
ExifExtendedTag
>
extendedTags
()
const
;
QList
<
GpsTag
>
gpsTags
()
const
;
bool
contains
(
ImageTag
tag
)
const
;
bool
contains
(
ExifExtendedTag
tag
)
const
;
bool
contains
(
GpsTag
tag
)
const
;
bool
contains
(
ImageTag
tag
)
const
;
bool
contains
(
ExifExtendedTag
tag
)
const
;
bool
contains
(
GpsTag
tag
)
const
;
void
remove
(
ImageTag
tag
);
void
remove
(
ExifExtendedTag
tag
);
void
remove
(
GpsTag
tag
);
void
remove
(
ImageTag
tag
);
void
remove
(
ExifExtendedTag
tag
);
void
remove
(
GpsTag
tag
);
QExifValue
value
(
ImageTag
tag
)
const
;
QExifValue
value
(
ExifExtendedTag
tag
)
const
;
QExifValue
value
(
GpsTag
tag
)
const
;
QExifValue
value
(
ImageTag
tag
)
const
;
QExifValue
value
(
ExifExtendedTag
tag
)
const
;
QExifValue
value
(
GpsTag
tag
)
const
;
void
setValue
(
ImageTag
tag
,
const
QExifValue
&
value
);
void
setValue
(
ExifExtendedTag
tag
,
const
QExifValue
&
value
);
void
setValue
(
GpsTag
tag
,
const
QExifValue
&
value
);
void
setValue
(
ImageTag
tag
,
const
QExifValue
&
value
);
void
setValue
(
ExifExtendedTag
tag
,
const
QExifValue
&
value
);
void
setValue
(
GpsTag
tag
,
const
QExifValue
&
value
);
QImage
thumbnail
()
const
;
void
setThumbnail
(
const
QImage
&
thumbnail
);
QImage
thumbnail
()
const
;
void
setThumbnail
(
const
QImage
&
thumbnail
);
private:
enum
PrivateTag
{
enum
PrivateTag
{
ExifIfdPointer
=
0x8769
,
GpsInfoIfdPointer
=
0x8825
,
InteroperabilityIfdPointer
=
0xA005
,
...
...
@@ -319,30 +307,30 @@ private:
JpegInterchangeFormatLength
=
0x0202
};
QByteArray
extractExif
(
QIODevice
*
device
)
const
;
QByteArray
extractExif
(
QIODevice
*
device
)
const
;
QList
<
ExifIfdHeader
>
readIfdHeaders
(
QDataStream
&
stream
)
const
;
QList
<
ExifIfdHeader
>
readIfdHeaders
(
QDataStream
&
stream
)
const
;
QExifValue
readIfdValue
(
QDataStream
&
stream
,
int
startPos
,
const
ExifIfdHeader
&
header
)
const
;
template
<
typename
T
>
QMap
<
T
,
QExifValue
>
readIfdValues
(
QDataStream
&
stream
,
int
startPos
,
const
QList
<
ExifIfdHeader
>
&
headers
)
const
;
template
<
typename
T
>
QMap
<
T
,
QExifValue
>
readIfdValues
(
QDataStream
&
stream
,
int
startPos
,
const
QExifValue
&
pointer
)
const
;
QExifValue
readIfdValue
(
QDataStream
&
stream
,
int
startPos
,
const
ExifIfdHeader
&
header
)
const
;
template
<
typename
T
>
QMap
<
T
,
QExifValue
>
readIfdValues
(
QDataStream
&
stream
,
int
startPos
,
const
QList
<
ExifIfdHeader
>
&
headers
)
const
;
template
<
typename
T
>
QMap
<
T
,
QExifValue
>
readIfdValues
(
QDataStream
&
stream
,
int
startPos
,
const
QExifValue
&
pointer
)
const
;
quint32
writeExifHeader
(
QDataStream
&
stream
,
quint16
tag
,
const
QExifValue
&
value
,
quint32
offset
)
const
;
void
writeExifValue
(
QDataStream
&
stream
,
const
QExifValue
&
value
)
const
;
quint32
writeExifHeader
(
QDataStream
&
stream
,
quint16
tag
,
const
QExifValue
&
value
,
quint32
offset
)
const
;
void
writeExifValue
(
QDataStream
&
stream
,
const
QExifValue
&
value
)
const
;
template
<
typename
T
>
quint32
writeExifHeaders
(
QDataStream
&
stream
,
const
QMap
<
T
,
QExifValue
>
&
values
,
quint32
offset
)
const
;
template
<
typename
T
>
void
writeExifValues
(
QDataStream
&
target
,
const
QMap
<
T
,
QExifValue
>
&
values
)
const
;
template
<
typename
T
>
quint32
writeExifHeaders
(
QDataStream
&
stream
,
const
QMap
<
T
,
QExifValue
>
&
values
,
quint32
offset
)
const
;
template
<
typename
T
>
void
writeExifValues
(
QDataStream
&
target
,
const
QMap
<
T
,
QExifValue
>
&
values
)
const
;
quint32
sizeOf
(
const
QExifValue
&
value
)
const
;
quint32
sizeOf
(
const
QExifValue
&
value
)
const
;
template
<
typename
T
>
quint32
calculateSize
(
const
QMap
<
T
,
QExifValue
>
&
values
)
const
;
template
<
typename
T
>
quint32
calculateSize
(
const
QMap
<
T
,
QExifValue
>
&
values
)
const
;
QExifImageHeaderPrivate
*
d
;
};
#endif
#endif
// ifndef QEXIFIMAGEHEADER_H
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment