mirror of
https://github.com/Intervention/image.git
synced 2025-08-30 17:19:50 +02:00
Include jp2k as jpeg2000 extension
This commit is contained in:
@@ -17,6 +17,7 @@ enum FileExtension: string
|
||||
case TIFF = 'tiff';
|
||||
case JP2 = 'jp2';
|
||||
case J2K = 'j2k';
|
||||
case JP2K = 'jp2k';
|
||||
case JPF = 'jpf';
|
||||
case JPM = 'jpm';
|
||||
case JPG2 = 'jpg2';
|
||||
@@ -44,6 +45,7 @@ enum FileExtension: string
|
||||
self::TIF,
|
||||
self::TIFF => Format::TIFF,
|
||||
self::JP2,
|
||||
self::JP2K,
|
||||
self::J2K,
|
||||
self::JPF,
|
||||
self::JPM,
|
||||
|
@@ -76,6 +76,9 @@ final class FileExtensionTest extends BaseTestCase
|
||||
|
||||
$ext = FileExtension::JPG2;
|
||||
$this->assertEquals(Format::JP2, $ext->format());
|
||||
|
||||
$ext = FileExtension::JP2K;
|
||||
$this->assertEquals(Format::JP2, $ext->format());
|
||||
}
|
||||
|
||||
public function testFormatHeic(): void
|
||||
|
@@ -271,7 +271,7 @@ final class FormatTest extends BaseTestCase
|
||||
$format = Format::JP2;
|
||||
$extensions = $format->fileExtensions();
|
||||
$this->assertIsArray($extensions);
|
||||
$this->assertCount(8, $extensions);
|
||||
$this->assertCount(9, $extensions);
|
||||
|
||||
$this->assertEquals(FileExtension::JP2, $format->fileExtension());
|
||||
}
|
||||
|
@@ -143,9 +143,9 @@ final class MediaTypeTest extends BaseTestCase
|
||||
yield [MediaType::IMAGE_X_WIN_BITMAP, 1, FileExtension::BMP];
|
||||
yield [MediaType::IMAGE_X_XBITMAP, 1, FileExtension::BMP];
|
||||
yield [MediaType::IMAGE_TIFF, 2, FileExtension::TIF];
|
||||
yield [MediaType::IMAGE_JP2, 8, FileExtension::JP2];
|
||||
yield [MediaType::IMAGE_JPX, 8, FileExtension::JP2];
|
||||
yield [MediaType::IMAGE_JPM, 8, FileExtension::JP2];
|
||||
yield [MediaType::IMAGE_JP2, 9, FileExtension::JP2];
|
||||
yield [MediaType::IMAGE_JPX, 9, FileExtension::JP2];
|
||||
yield [MediaType::IMAGE_JPM, 9, FileExtension::JP2];
|
||||
yield [MediaType::IMAGE_HEIC, 2, FileExtension::HEIC];
|
||||
yield [MediaType::IMAGE_X_HEIC, 2, FileExtension::HEIC];
|
||||
yield [MediaType::IMAGE_HEIF, 2, FileExtension::HEIC];
|
||||
|
Reference in New Issue
Block a user