1
0
mirror of https://github.com/Intervention/image.git synced 2025-01-16 19:58:14 +01:00

Add non-standard mime type image/x-heic

This commit is contained in:
Oliver Vogel 2024-07-10 13:49:46 +02:00
parent 5451ff9f90
commit 6daaedf7ed
No known key found for this signature in database
GPG Key ID: 1B19D214C02D69BB
3 changed files with 7 additions and 2 deletions

View File

@ -30,6 +30,7 @@ enum MediaType: string
case IMAGE_JPX = 'image/jpx';
case IMAGE_JPM = 'image/jpm';
case IMAGE_HEIC = 'image/heic';
case IMAGE_X_HEIC = 'image/x-heic';
case IMAGE_HEIF = 'image/heif';
/**
@ -64,7 +65,8 @@ enum MediaType: string
self::IMAGE_JPX,
self::IMAGE_JPM => Format::JP2,
self::IMAGE_HEIF,
self::IMAGE_HEIC => Format::HEIC,
self::IMAGE_HEIC,
self::IMAGE_X_HEIC => Format::HEIC,
};
}
}

View File

@ -119,7 +119,7 @@ final class FormatTest extends BaseTestCase
$format = Format::HEIC;
$mediaTypes = $format->mediaTypes();
$this->assertIsArray($mediaTypes);
$this->assertCount(2, $mediaTypes);
$this->assertCount(3, $mediaTypes);
}
public function testEncoderJpeg(): void

View File

@ -99,6 +99,9 @@ final class MediaTypeTest extends BaseTestCase
$mime = MediaType::IMAGE_HEIC;
$this->assertEquals(Format::HEIC, $mime->format());
$mime = MediaType::IMAGE_X_HEIC;
$this->assertEquals(Format::HEIC, $mime->format());
$mime = MediaType::IMAGE_HEIF;
$this->assertEquals(Format::HEIC, $mime->format());
}