mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 23:17:45 +00:00
LibGfx+icc: ICCProfile's primary_platform() should be optional
Found by running `icc` on a jpeg file produced by a Pixel phone after #17195.
This commit is contained in:
parent
3cd04f40e1
commit
87f1a0e957
3 changed files with 8 additions and 4 deletions
|
@ -243,9 +243,13 @@ ErrorOr<void> parse_file_signature(ICCHeader const& header)
|
|||
return {};
|
||||
}
|
||||
|
||||
ErrorOr<PrimaryPlatform> parse_primary_platform(ICCHeader const& header)
|
||||
ErrorOr<Optional<PrimaryPlatform>> parse_primary_platform(ICCHeader const& header)
|
||||
{
|
||||
// ICC v4, 7.2.10 Primary platform field
|
||||
// "If there is no primary platform identified, this field shall be set to zero (00000000h)."
|
||||
if (header.primary_platform == PrimaryPlatform { 0 })
|
||||
return OptionalNone {};
|
||||
|
||||
switch (header.primary_platform) {
|
||||
case PrimaryPlatform::Apple:
|
||||
case PrimaryPlatform::Microsoft:
|
||||
|
|
|
@ -572,7 +572,7 @@ public:
|
|||
|
||||
u32 on_disk_size() const { return m_on_disk_size; }
|
||||
time_t creation_timestamp() const { return m_creation_timestamp; }
|
||||
PrimaryPlatform primary_platform() const { return m_primary_platform; }
|
||||
Optional<PrimaryPlatform> primary_platform() const { return m_primary_platform; }
|
||||
Flags flags() const { return m_flags; }
|
||||
Optional<DeviceManufacturer> device_manufacturer() const { return m_device_manufacturer; }
|
||||
Optional<DeviceModel> device_model() const { return m_device_model; }
|
||||
|
@ -609,7 +609,7 @@ private:
|
|||
ColorSpace m_data_color_space {};
|
||||
ColorSpace m_connection_space {};
|
||||
time_t m_creation_timestamp { 0 };
|
||||
PrimaryPlatform m_primary_platform {};
|
||||
Optional<PrimaryPlatform> m_primary_platform {};
|
||||
Flags m_flags;
|
||||
Optional<DeviceManufacturer> m_device_manufacturer;
|
||||
Optional<DeviceModel> m_device_model;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue