2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
11 #include "XBDateTime.h"
12 #include "pictures/metadata/ImageMetadata.h"
13 #include "utils/IArchivable.h"
14 #include "utils/ISerializable.h"
15 #include "utils/ISortable.h"
25 } /* namespace ADDONS */
26 } /* namespace KODI */
30 class CPictureInfoTag
: public IArchivable
, public ISerializable
, public ISortable
32 friend class KODI::ADDONS::CImageDecoder
;
35 CPictureInfoTag() { Reset(); }
36 virtual ~CPictureInfoTag() = default;
38 void Archive(CArchive
& ar
) override
;
39 void Serialize(CVariant
& value
) const override
;
40 void ToSortable(SortItem
& sortable
, Field field
) const override
;
41 const std::string
GetInfo(int info
) const;
43 bool Loaded() const { return m_isLoaded
; }
44 bool Load(const std::string
&path
);
46 void SetInfo(const std::string
& key
, const std::string
& value
);
49 * GetDateTimeTaken() -- Returns the EXIF DateTimeOriginal for current picture
51 * The exif library returns DateTimeOriginal if available else the other
54 const CDateTime
& GetDateTimeTaken() const;
56 static int TranslateString(const std::string
&info
);
58 ImageMetadata m_imageMetadata
;
59 bool m_isLoaded
; // Set to true if metadata has been loaded from the picture file successfully
60 bool m_isInfoSetExternally
; // Set to true if metadata has been set by an external call to SetInfo
61 CDateTime m_dateTimeTaken
;
62 void ConvertDateTime();