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

Add 'image/x-jp2-codestream' as Jpeg2000 mime type

This commit is contained in:
Oliver Vogel 2024-12-30 09:45:35 +01:00
parent 8e12c2e152
commit c66fa7dac8
No known key found for this signature in database
3 changed files with 4 additions and 2 deletions

View File

@ -27,6 +27,7 @@ enum MediaType: string
case IMAGE_X_XBITMAP = 'image/x-xbitmap';
case IMAGE_TIFF = 'image/tiff';
case IMAGE_JP2 = 'image/jp2';
case IMAGE_X_JP2_CODESTREAM = 'image/x-jp2-codestream';
case IMAGE_JPX = 'image/jpx';
case IMAGE_JPM = 'image/jpm';
case IMAGE_HEIC = 'image/heic';
@ -63,6 +64,7 @@ enum MediaType: string
self::IMAGE_TIFF => Format::TIFF,
self::IMAGE_JP2,
self::IMAGE_JPX,
self::IMAGE_X_JP2_CODESTREAM,
self::IMAGE_JPM => Format::JP2,
self::IMAGE_HEIF,
self::IMAGE_HEIC,

View File

@ -104,7 +104,7 @@ final class FileExtensionTest extends BaseTestCase
yield [FileExtension::BMP, 8, MediaType::IMAGE_BMP];
yield [FileExtension::TIFF, 1, MediaType::IMAGE_TIFF];
yield [FileExtension::TIF, 1, MediaType::IMAGE_TIFF];
yield [FileExtension::JP2, 3, MediaType::IMAGE_JP2];
yield [FileExtension::JP2, 4, MediaType::IMAGE_JP2];
yield [FileExtension::HEIC, 3, MediaType::IMAGE_HEIC];
}
}

View File

@ -127,7 +127,7 @@ final class FormatTest extends BaseTestCase
$format = Format::JP2;
$mediaTypes = $format->mediaTypes();
$this->assertIsArray($mediaTypes);
$this->assertCount(3, $mediaTypes);
$this->assertCount(4, $mediaTypes);
$this->assertEquals(MediaType::IMAGE_JP2, $format->mediaType());
}