JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
ImageType.java
Go to the documentation of this file.
1/**
2 * Copyright 2014 JogAmp Community. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without modification, are
5 * permitted provided that the following conditions are met:
6 *
7 * 1. Redistributions of source code must retain the above copyright notice, this list of
8 * conditions and the following disclaimer.
9 *
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * The views and conclusions contained in the software and documentation are those of the
25 * authors and should not be interpreted as representing official policies, either expressed
26 * or implied, of JogAmp Community.
27 */
28package com.jogamp.opengl.util.texture;
29
30import java.io.BufferedInputStream;
31import java.io.IOException;
32import java.io.InputStream;
33
34/**
35 * Image type classification.
36 * <p>
37 * Allows to classify the {@link ImageType} of an {@link InputStream} via {@link #ImageType(InputStream)}
38 * or to simply define one {@link ImageType} via {@link #ImageType(String)}.
39 * </p>
40 * @since 2.3.2
41 */
42public class ImageType {
43 /**
44 * Minimum number of bytes to determine the image data type, i.e. {@value} bytes.
45 */
46 public static final int MAGIC_MAX_SIZE = 25;
47
48 /**
49 * Constant which can be used as a file suffix to indicate a JPEG stream, value {@value}.
50 * <ul>
51 * <li>{@code http://www.faqs.org/faqs/jpeg-faq/part1/}</li>
52 * <li>{@code http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=54989}</li>
53 * </ul>
54 */
55 public static final String T_JPG = "jpg";
56
57 /**
58 * Constant which can be used as a file suffix to indicate a PNG stream, value {@value}.
59 * <ul>
60 * <li>{@code http://www.libpng.org/pub/png/spec/1.1/PNG-Rationale.html#R.PNG-file-signature}</li>
61 * </ul>
62 */
63 public static final String T_PNG = "png";
64
65 /**
66 * Constant which can be used as a file suffix to indicate an Apple Icon Image stream, value {@value}.
67 * <p>
68 * {@code 'i' 'c' 'n' 's' ascii code}
69 * </p>
70 * <ul>
71 * <li>{@code TODO}</li>
72 * </ul>
73 */
74 public static final String T_ICNS = "icns";
75
76 /**
77 * Constant which can be used as a file suffix to indicate a Microsoft Windows Icon stream, value {@value}.
78 * <p>
79 * TODO
80 * </p>
81 * <ul>
82 * <li>{@code https://msdn.microsoft.com/en-us/library/ms997538.aspx}</li>
83 * </ul>
84 */
85 public static final String T_ICO = "ico";
86
87 /**
88 * Constant which can be used as a file suffix to indicate a Microsoft Windows Cursor stream, value {@value}.
89 * <p>
90 * TODO
91 * </p>
92 * <ul>
93 * <li>{@code TODO}</li>
94 * </ul>
95 */
96 public static final String T_CUR = "cur";
97
98 /**
99 * Constant which can be used as a file suffix to indicate a GIF stream, value {@value}.
100 * <p>
101 * {@code GIF87A or GIF89A ascii code}
102 * </p>
103 * <ul>
104 * <li>{@code http://www.w3.org/Graphics/GIF/spec-gif87a.txt http://www.w3.org/Graphics/GIF/spec-gif89a.txt}</li>
105 * </ul>
106 */
107 public static final String T_GIF = "gif";
108
109 /**
110 * Constant which can be used as a file suffix to indicate a GIF stream, value {@value}.
111 * <p>
112 * {@code BM ascii code}
113 * </p>
114 * <p>
115 * FIXME: Collision or supertype of {@link #T_DIB}?
116 * </p>
117 * <ul>
118 * <li>{@code http://www.fileformat.info/format/bmp/spec/e27073c25463436f8a64fa789c886d9c/view.htm}</li>
119 * </ul>
120 */
121 public static final String T_BMP = "bmp";
122
123 /**
124 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
125 * <p>
126 * FIXME: Collision or subtype of {@link #T_BMP}?
127 * </p>
128 * <ul>
129 * <li>{@code TODO}</li>
130 * </ul>
131 */
132 public static final String T_DIB = "dib";
133
134 /**
135 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
136 * <p>
137 * TODO
138 * </p>
139 * <ul>
140 * <li>{@code TODO}</li>
141 * </ul>
142 */
143 public static final String T_DCX = "dcx";
144
145 /**
146 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
147 * <p>
148 * TODO
149 * </p>
150 * <ul>
151 * <li>{@code TODO}</li>
152 * </ul>
153 */
154 public static final String T_PCX = "pcx";
155
156 /**
157 * Constant which can be used as a file suffix to indicate a PAM stream, NetPbm magic 6 - binary RGB.
158 * <ul>
159 * <li>{@code http://netpbm.sourceforge.net/doc/ppm.html}</li>
160 * </ul>
161 */
162 public static final String T_PPM = "ppm";
163
164 /**
165 * Constant which can be used as a file suffix to indicate a Adobe PhotoShop stream, value {@value}.
166 * <p>
167 * TODO
168 * </p>
169 * <ul>
170 * <li>{@code TODO}</li>
171 * </ul>
172 */
173 public static final String T_PSD = "psd";
174
175 /**
176 * Constant which can be used as a file suffix to indicate a TIFF stream, value {@value}.
177 * <p>
178 * Intentionally detects only the little endian tiff images ("II" in the spec).
179 * </p>
180 * <p>
181 * FIXME: Collision or supertype of {@link #T_LDF}?
182 * </p>
183 * <ul>
184 * <li>{@code http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf}</li>
185 * </ul>
186 */
187 public static final String T_TIFF = "tiff";
188
189 /**
190 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
191 * <p>
192 * FIXME: Collision or subtype of {@link #T_TIFF}?
193 * </p>
194 * <ul>
195 * <li>{@code TODO}</li>
196 * </ul>
197 */
198 public static final String T_LDF = "ldf";
199
200 /**
201 * Constant which can be used as a file suffix to indicate an SGI RGB stream, value {@value}.
202 * <p>
203 * "474 saved as a short" 474 = 0x01DA
204 * </p>
205 * <ul>
206 * <li>{@code http://paulbourke.net/dataformats/sgirgb/sgiversion.html}</li>
207 * </ul>
208 */
209 public static final String T_SGI_RGB = "rgb";
210
211 /**
212 * Constant which can be used as a file suffix to indicate a DirectDraw Surface stream, value {@value}.
213 * <p>
214 * 'D' 'D' 'S' ' ' ascii code
215 * </p>
216 * <ul>
217 * <li>{@code https://msdn.microsoft.com/en-us/library/windows/desktop/bb943991%28v=vs.85%29.aspx#File_Layout1}</li>
218 * </ul>
219 */
220 public static final String T_DDS = "dds";
221
222 /**
223 * Constant which can be used as a file suffix to indicate a Portable Arbitrary Map stream, NetPbm magic 7 - binary RGB and RGBA.
224 * <ul>
225 * <li>{@code http://netpbm.sourceforge.net/doc/pam.html}</li>
226 * </ul>
227 */
228 public static final String T_PAM = "pam";
229
230 /**
231 * Constant which can be used as a file suffix to indicate a PGM stream, NetPbm magic 5 - binary grayscale.
232 * <ul>
233 * <li>{@code http://netpbm.sourceforge.net/doc/pgm.html}</li>
234 * </ul>
235 */
236 public static final String T_PGM = "pgm";
237
238 /**
239 * Constant which can be used as a file suffix to indicate a PGM stream, NetPbm magic 4 - binary monochrome.
240 * <ul>
241 * <li>{@code http://netpbm.sourceforge.net/doc/pbm.html}</li>
242 * </ul>
243 */
244 public static final String T_PBM = "pbm";
245
246 /**
247 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
248 * <p>
249 * TODO
250 * </p>
251 * <ul>
252 * <li>{@code TODO}</li>
253 * </ul>
254 */
255 public static final String T_3D2 = "3d2";
256
257 /**
258 * Constant which can be used as a file suffix to indicate an Apple QuickDraw 3D 3DMF stream, value {@value}.
259 * <p>
260 * TODO
261 * </p>
262 * <ul>
263 * <li>{@code TODO}</li>
264 * </ul>
265 */
266 public static final String T_3DMF = "3dmf";
267
268 /**
269 * Constant which can be used as a file suffix to indicate a Texas Instruments TI-92 Bitmap stream, value {@value}.
270 * <p>
271 * TODO
272 * </p>
273 * <ul>
274 * <li>{@code TODO}</li>
275 * </ul>
276 */
277 public static final String T_92I = "92i";
278
279 /**
280 * Constant which can be used as a file suffix to indicate an Amiga metafile stream, value {@value}.
281 * <p>
282 * TODO
283 * </p>
284 * <ul>
285 * <li>{@code TODO}</li>
286 * </ul>
287 */
288 public static final String T_AMFF = "amff";
289
290 /**
291 * Constant which can be used as a file suffix to indicate an America Online Art stream, value {@value}.
292 * <p>
293 * TODO
294 * </p>
295 * <ul>
296 * <li>{@code TODO}</li>
297 * </ul>
298 */
299 public static final String T_ART = "art";
300
301 /**
302 * Constant which can be used as a file suffix to indicate a United States Department of Defence Continuous Acquisition and Life-cycle Support Raster stream, value {@value}.
303 * <p>
304 * TODO
305 * </p>
306 * <ul>
307 * <li>{@code http://www.fileformat.info/format/cals/egff.htm}</li>
308 * </ul>
309 */
310 public static final String T_CALS = "cals";
311
312 /**
313 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
314 * <p>
315 * TODO
316 * </p>
317 * <ul>
318 * <li>{@code TODO}</li>
319 * </ul>
320 */
321 public static final String T_CAM = "cam";
322
323 /**
324 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
325 * <p>
326 * TODO
327 * </p>
328 * <ul>
329 * <li>{@code TODO}</li>
330 * </ul>
331 */
332 public static final String T_CBD = "cbd";
333
334
335 /**
336 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
337 * <p>
338 * TODO
339 * </p>
340 * <ul>
341 * <li>{@code TODO}</li>
342 * </ul>
343 */
344 public static final String T_CE2 = "ce2";
345
346 /**
347 * Constant which can be used as a file suffix to indicate a Kodak Cineon System stream, value {@value}.
348 * <p>
349 * TODO
350 * </p>
351 * <ul>
352 * <li>{@code http://www.cineon.com/ff_draft.php}</li>
353 * </ul>
354 */
355 public static final String T_CIN = "cin";
356
357 /**
358 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
359 * <p>
360 * TODO
361 * </p>
362 * <ul>
363 * <li>{@code TODO}</li>
364 * </ul>
365 */
366 public static final String T_COB = "cob";
367
368 /**
369 * Constant which can be used as a file suffix to indicate a Corel Photo Paint stream, value {@value}.
370 * <p>
371 * TODO
372 * </p>
373 * <ul>
374 * <li>{@code TODO}</li>
375 * </ul>
376 */
377 public static final String T_CPT = "cpt";
378
379 /**
380 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
381 * <p>
382 * TODO
383 * </p>
384 * <ul>
385 * <li>{@code TODO}</li>
386 * </ul>
387 */
388 public static final String T_CVG = "cvg";
389
390
391 /**
392 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
393 * <p>
394 * TODO
395 * </p>
396 * <ul>
397 * <li>{@code TODO}</li>
398 * </ul>
399 */
400 public static final String T_DEM = "dem";
401
402 /**
403 * Constant which can be used as a file suffix to indicate a Digital Picture Exchange stream, value {@value}.
404 * <p>
405 * TODO
406 * </p>
407 * <ul>
408 * <li>{@code TODO}</li>
409 * </ul>
410 */
411 public static final String T_DPX = "dpx";
412
413 /**
414 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
415 * <p>
416 * TODO
417 * </p>
418 * <ul>
419 * <li>{@code TODO}</li>
420 * </ul>
421 */
422 public static final String T_DRW = "drw";
423
424 /**
425 * Constant which can be used as a file suffix to indicate a Autocad drawing stream, value {@value}.
426 * <p>
427 * TODO
428 * </p>
429 * <ul>
430 * <li>{@code TODO}</li>
431 * </ul>
432 */
433 public static final String T_DWG = "dwg";
434
435 /**
436 * Constant which can be used as a file suffix to indicate a Hexagon Geospatial Enhanced Compression Wavelet stream, value {@value}.
437 * <p>
438 * TODO
439 * </p>
440 * <ul>
441 * <li>{@code TODO}</li>
442 * </ul>
443 */
444 public static final String T_ECW = "ecw";
445
446 /**
447 * Constant which can be used as a file suffix to indicate a Microsoft Windows Enhanced metafile stream, value {@value}.
448 * <p>
449 * TODO
450 * </p>
451 * <ul>
452 * <li>{@code TODO}</li>
453 * </ul>
454 */
455 public static final String T_EMF = "emf";
456
457 /**
458 * Constant which can be used as a file suffix to indicate a FlashPix stream, value {@value}.
459 * <p>
460 * TODO
461 * </p>
462 * <ul>
463 * <li>{@code TODO}</li>
464 * </ul>
465 */
466 public static final String T_FPX = "fpx";
467
468 /**
469 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
470 * <p>
471 * TODO
472 * </p>
473 * <ul>
474 * <li>{@code TODO}</li>
475 * </ul>
476 */
477 public static final String T_FTS = "fts";
478
479 /**
480 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
481 * <p>
482 * TODO
483 * </p>
484 * <ul>
485 * <li>{@code TODO}</li>
486 * </ul>
487 */
488 public static final String T_GRO = "gro";
489
490 /**
491 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
492 * <p>
493 * TODO
494 * </p>
495 * <ul>
496 * <li>{@code TODO}</li>
497 * </ul>
498 */
499 public static final String T_HDR = "hdr";
500
501 /**
502 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
503 * <p>
504 * TODO
505 * </p>
506 * <ul>
507 * <li>{@code TODO}</li>
508 * </ul>
509 */
510 public static final String T_HRU = "hru";
511
512 /**
513 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
514 * <p>
515 * TODO
516 * </p>
517 * <ul>
518 * <li>{@code TODO}</li>
519 * </ul>
520 */
521 public static final String T_IMG = "img";
522
523 /**
524 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
525 * <p>
526 * TODO
527 * </p>
528 * <ul>
529 * <li>{@code TODO}</li>
530 * </ul>
531 */
532 public static final String T_INFINI_D = "infini-d";
533
534 /**
535 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
536 * <p>
537 * TODO
538 * </p>
539 * <ul>
540 * <li>{@code TODO}</li>
541 * </ul>
542 */
543 public static final String T_IWC = "iwc";
544
545 /**
546 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
547 * <p>
548 * TODO
549 * </p>
550 * <ul>
551 * <li>{@code TODO}</li>
552 * </ul>
553 */
554 public static final String T_J6I = "j6i";
555
556 /**
557 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
558 * <p>
559 * TODO
560 * </p>
561 * <ul>
562 * <li>{@code TODO}</li>
563 * </ul>
564 */
565 public static final String T_JIF = "jif";
566
567 /**
568 * Constant which can be used as a file suffix to indicate a JPEG-2000 stream, value {@value}.
569 * <p>
570 * TODO
571 * </p>
572 * <ul>
573 * <li>{@code TODO}</li>
574 * </ul>
575 */
576 public static final String T_JP2 = "jp2";
577
578 /**
579 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
580 * <p>
581 * TODO
582 * </p>
583 * <ul>
584 * <li>{@code TODO}</li>
585 * </ul>
586 */
587 public static final String T_KDC = "kdc";
588
589 /**
590 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
591 * <p>
592 * TODO
593 * </p>
594 * <ul>
595 * <li>{@code TODO}</li>
596 * </ul>
597 */
598 public static final String T_L64 = "l64";
599
600 /**
601 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
602 * <p>
603 * FIXME: Collision or supertype of {@link #T_RAD}?
604 * </p>
605 * <ul>
606 * <li>{@code TODO}</li>
607 * </ul>
608 */
609 public static final String T_LBM = "lbm";
610
611 /**
612 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
613 * <p>
614 * FIXME: Collision or subtype of {@link #T_LBM}?
615 * </p>
616 * <ul>
617 * <li>{@code TODO}</li>
618 * </ul>
619 */
620 public static final String T_RAD = "rad";
621
622 /**
623 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
624 * <p>
625 * TODO
626 * </p>
627 * <ul>
628 * <li>{@code TODO}</li>
629 * </ul>
630 */
631 public static final String T_LWF = "lwf";
632
633 /**
634 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
635 * <p>
636 * TODO
637 * </p>
638 * <ul>
639 * <li>{@code TODO}</li>
640 * </ul>
641 */
642 public static final String T_MBM = "mbm";
643
644 /**
645 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
646 * <p>
647 * TODO
648 * </p>
649 * <ul>
650 * <li>{@code TODO}</li>
651 * </ul>
652 */
653 public static final String T_MGL = "mgl";
654
655 /**
656 * Constant which can be used as a file suffix to indicate an Imagemagick stream, value {@value}.
657 * <p>
658 * TODO
659 * </p>
660 * <ul>
661 * <li>{@code TODO}</li>
662 * </ul>
663 */
664 public static final String T_MIF = "mif";
665
666 /**
667 * Constant which can be used as a file suffix to indicate a Multiple-image Network Graphics stream, value {@value}.
668 * <p>
669 * TODO
670 * </p>
671 * <ul>
672 * <li>{@code TODO}</li>
673 * </ul>
674 */
675 public static final String T_MNG = "mng";
676
677 /**
678 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
679 * <p>
680 * TODO
681 * </p>
682 * <ul>
683 * <li>{@code TODO}</li>
684 * </ul>
685 */
686 public static final String T_MPW = "mpw";
687
688 /**
689 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
690 * <p>
691 * TODO
692 * </p>
693 * <ul>
694 * <li>{@code TODO}</li>
695 * </ul>
696 */
697 public static final String T_MSP = "msp";
698
699 /**
700 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
701 * <p>
702 * TODO
703 * </p>
704 * <ul>
705 * <li>{@code TODO}</li>
706 * </ul>
707 */
708 public static final String T_N64 = "n64";
709
710 /**
711 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
712 * <p>
713 * TODO
714 * </p>
715 * <ul>
716 * <li>{@code TODO}</li>
717 * </ul>
718 */
719 public static final String T_NCR = "ncr";
720
721 /**
722 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
723 * <p>
724 * TODO
725 * </p>
726 * <ul>
727 * <li>{@code TODO}</li>
728 * </ul>
729 */
730 public static final String T_NFF = "nff";
731
732 /**
733 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
734 * <p>
735 * TODO
736 * </p>
737 * <ul>
738 * <li>{@code TODO}</li>
739 * </ul>
740 */
741 public static final String T_NGG = "ngg";
742
743 /**
744 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
745 * <p>
746 * TODO
747 * </p>
748 * <ul>
749 * <li>{@code TODO}</li>
750 * </ul>
751 */
752 public static final String T_NLM = "nlm";
753
754 /**
755 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
756 * <p>
757 * TODO
758 * </p>
759 * <ul>
760 * <li>{@code TODO}</li>
761 * </ul>
762 */
763 public static final String T_NOL = "nol";
764
765 /**
766 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
767 * <p>
768 * TODO
769 * </p>
770 * <ul>
771 * <li>{@code TODO}</li>
772 * </ul>
773 */
774 public static final String T_PAL = "pal";
775
776 /**
777 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
778 * <p>
779 * TODO
780 * </p>
781 * <ul>
782 * <li>{@code TODO}</li>
783 * </ul>
784 */
785 public static final String T_PAX = "pax";
786
787 /**
788 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
789 * <p>
790 * TODO
791 * </p>
792 * <ul>
793 * <li>{@code TODO}</li>
794 * </ul>
795 */
796 public static final String T_PCD = "pcd";
797
798 /**
799 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
800 * <p>
801 * TODO
802 * </p>
803 * <ul>
804 * <li>{@code TODO}</li>
805 * </ul>
806 */
807 public static final String T_PCL = "pcl";
808
809 /**
810 * Constant which can be used as a file suffix to indicate a Softimage pic stream, value {@value}.
811 * <p>
812 * TODO
813 * </p>
814 * <ul>
815 * <li>{@code http://paulbourke.net/dataformats/softimagepic/}</li>
816 * </ul>
817 */
818 public static final String T_PIC = "pic";
819
820 /**
821 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
822 * <p>
823 * TODO
824 * </p>
825 * <ul>
826 * <li>{@code TODO}</li>
827 * </ul>
828 */
829 public static final String T_PIX = "pix";
830
831 /**
832 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
833 * <p>
834 * TODO
835 * </p>
836 * <ul>
837 * <li>{@code TODO}</li>
838 * </ul>
839 */
840 public static final String T_POL = "pol";
841
842 /**
843 * Constant which can be used as a file suffix to indicate a PaintShop Pro stream, value {@value}.
844 * <p>
845 * TODO
846 * </p>
847 * <ul>
848 * <li>{@code TODO}</li>
849 * </ul>
850 */
851 public static final String T_PSP = "psp";
852
853 /**
854 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
855 * <p>
856 * TODO
857 * </p>
858 * <ul>
859 * <li>{@code TODO}</li>
860 * </ul>
861 */
862 public static final String T_QFX = "qfx";
863
864 /**
865 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
866 * <p>
867 * TODO
868 * </p>
869 * <ul>
870 * <li>{@code TODO}</li>
871 * </ul>
872 */
873 public static final String T_QTM = "qtm";
874
875 /**
876 * Constant which can be used as a file suffix to indicate a Sun Raster stream, value {@value}.
877 * <p>
878 * TODO
879 * </p>
880 * <ul>
881 * <li>{@code TODO}</li>
882 * </ul>
883 */
884 public static final String T_RAS = "ras";
885
886 /**
887 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
888 * <p>
889 * TODO
890 * </p>
891 * <ul>
892 * <li>{@code TODO}</li>
893 * </ul>
894 */
895 public static final String T_RIX = "rix";
896
897 /**
898 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
899 * <p>
900 * TODO
901 * </p>
902 * <ul>
903 * <li>{@code TODO}</li>
904 * </ul>
905 */
906 public static final String T_SID = "sid";
907
908 /**
909 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
910 * <p>
911 * TODO
912 * </p>
913 * <ul>
914 * <li>{@code TODO}</li>
915 * </ul>
916 */
917 public static final String T_SLD = "sld";
918
919
920 /**
921 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
922 * <p>
923 * TODO
924 * </p>
925 * <ul>
926 * <li>{@code TODO}</li>
927 * </ul>
928 */
929 public static final String T_SOD = "sod";
930
931
932 /**
933 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
934 * <p>
935 * TODO
936 * </p>
937 * <ul>
938 * <li>{@code TODO}</li>
939 * </ul>
940 */
941 public static final String T_WIC = "wic";
942
943 /**
944 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
945 * <p>
946 * TODO
947 * </p>
948 * <ul>
949 * <li>{@code TODO}</li>
950 * </ul>
951 */
952 public static final String T_WLM = "wlm";
953
954 /**
955 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
956 * <p>
957 * TODO
958 * </p>
959 * <ul>
960 * <li>{@code TODO}</li>
961 * </ul>
962 */
963 public static final String T_WMF = "wmf";
964
965 /**
966 * Constant which can be used as a file suffix to indicate a Wordperfect Graphics vectors stream, value {@value}.
967 * <p>
968 * TODO
969 * </p>
970 * <ul>
971 * <li>{@code TODO}</li>
972 * </ul>
973 */
974 public static final String T_WPG = "wpg";
975
976 /**
977 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
978 * <p>
979 * TODO
980 * </p>
981 * <ul>
982 * <li>{@code TODO}</li>
983 * </ul>
984 */
985 public static final String T_WRL = "wrl";
986
987 /**
988 * Constant which can be used as a file suffix to indicate a {@code TBD} stream, value {@value}.
989 * <p>
990 * TODO
991 * </p>
992 * <ul>
993 * <li>{@code TODO}</li>
994 * </ul>
995 */
996 public static final String T_XBM = "xbm";
997
998 /**
999 * Constant which can be used as a file suffix to indicate a X PixMap stream, value {@value}.
1000 * <p>
1001 * TODO
1002 * </p>
1003 * <ul>
1004 * <li>{@code TODO}</li>
1005 * </ul>
1006 */
1007 public static final String T_XPM = "xpm";
1008
1009 /**
1010 * Constant which can be used as a file suffix to indicate a Targa stream, value {@value}.
1011 * <ul>
1012 * <li>{@code }</li>
1013 * </ul>
1014 */
1015 public static final String T_TGA = "tga";
1016
1017 /**
1018 * The determined unique type, e.g. {@link #T_PNG}, {@link #T_JPG}, etc.
1019 * <p>
1020 * Maybe {@code null} if undetermined, i.e. {@link #isDefined()} returns {@code false}.
1021 * </p>
1022 */
1023 public final String type;
1024
1025 /**
1026 * The optionally read header of size {@link #MAGIC_MAX_SIZE} bytes as used to determine the {@link #type},
1027 * i.e. {@link #ImageType(InputStream)}.
1028 * <p>
1029 * May be {@code null}, if {@link #type} has been determined otherwise, i.e {@link #ImageType(String)}.
1030 * </p>
1031 * <p>
1032 * The header is <i>not</i> being used for {@link #hashCode()} and {@link #equals(Object)}!
1033 * </p>
1034 */
1035 public final byte[] header;
1036
1037 private final int hash;
1038
1039 /**
1040 * Creates instance based on given stream.
1041 * @param stream stream to parse, {@link InputStream#available()} must be &ge; {@link #MAGIC_MAX_SIZE}
1042 * @throws java.io.IOException if an I/O exception occurred
1043 */
1044 public ImageType(final InputStream stream) throws IOException {
1045 final byte[] _header = new byte[MAGIC_MAX_SIZE];
1046 type = Util.getFileSuffix(stream, _header);
1047 this.header = _header;
1048 this.hash = null != this.type ? this.type.hashCode() : 0;
1049 }
1050 /**
1051 * Creates instance based on the given type.
1052 * @param type must be one of {@link #T_PNG}, {@link #T_JPG}, etc.
1053 */
1054 public ImageType(final String type) {
1055 this.header = null;
1056 this.type = type;
1057 this.hash = this.type.hashCode();
1058 }
1059 /** Returns {@code true} if {@link #type} is determined, i.e. not {@code null}, otherwise {@code false}. */
1060 public final boolean isDefined() { return null != type; }
1061
1062 @Override
1063 public final int hashCode() {
1064 return hash;
1065 }
1066 @Override
1067 public boolean equals(final Object o) {
1068 if( o == this ) {
1069 return true;
1070 } else if( o instanceof ImageType ) {
1071 final ImageType t = (ImageType)o;
1072 return this.type.equals(t.type);
1073 } else {
1074 return false;
1075 }
1076 }
1077 @Override
1078 public String toString() { return "ImageType["+type+"]"; }
1079
1080 /**
1081 * Static utility functions for {@link ImageType}
1082 * to determine the {@link ImageType#type}.
1083 * @since 2.3.2
1084 */
1085 public static class Util {
1086 /**
1087 * Determines the file suffix (i.e the image format) of the given InputStream. The given
1088 * InputStream must return true from markSupported() and support a minimum of {@link #MAGIC_MAX_SIZE} bytes
1089 * of read-ahead.
1090 *
1091 * @param stream stream to parse, {@link InputStream#available()} must be &ge; {@link #MAGIC_MAX_SIZE}
1092 * @return the file suffix if any, otherwise <code>null</code>
1093 * @throws java.io.IOException if an I/O exception occurred
1094 */
1095 public static String getFileSuffix(final InputStream stream) throws IOException {
1096 return getFileSuffix(stream, new byte[MAGIC_MAX_SIZE]);
1097 }
1098 /**
1099 * Determines the file suffix (i.e the image format) of the given InputStream. The given
1100 * InputStream must return true from markSupported() and support a minimum of {@link #MAGIC_MAX_SIZE} bytes
1101 * of read-ahead.
1102 *
1103 * @param stream stream to parse, {@link InputStream#available()} must be &ge; {@link #MAGIC_MAX_SIZE}
1104 * @param b byte array sink, size must be &ge; {@link #MAGIC_MAX_SIZE}
1105 * @return the file suffix if any, otherwise <code>null</code>
1106 * @throws java.io.IOException if an I/O exception occurred
1107 */
1108 public static String getFileSuffix(InputStream stream, final byte[] b) throws IOException {
1109 if (stream == null) {
1110 throw new IOException("Stream was null");
1111 }
1112 if (!(stream instanceof BufferedInputStream)) {
1113 stream = new BufferedInputStream(stream);
1114 }
1115 if (!stream.markSupported()) {
1116 throw new IOException("Mark not supported");
1117 }
1118 if (stream.available() < MAGIC_MAX_SIZE) {
1119 throw new IOException("Requires "+MAGIC_MAX_SIZE+" bytes, has "+stream.available()+" bytes");
1120 }
1121 try {
1122 stream.mark(MAGIC_MAX_SIZE);
1123 final int bytesRead = stream.read(b);
1124 if( MAGIC_MAX_SIZE > bytesRead ) {
1125 throw new IOException("Could not read "+MAGIC_MAX_SIZE+" bytes, read "+bytesRead+" bytes");
1126 }
1127 return getFileSuffix(b);
1128 } finally {
1129 stream.reset();
1130 }
1131
1132 }
1133
1134 /**
1135 * Determines the file suffix (i.e the image format) of the given bytes from the header
1136 * of a file.
1137 *
1138 * @param b byte array to parse, size must be &ge; {@link #MAGIC_MAX_SIZE}
1139 * @return the file suffix if any, otherwise <code>null</code>
1140 * @throws java.io.IOException if an I/O exception occurred
1141 */
1142 public static String getFileSuffix(final byte[] b) {
1143 if( b.length < MAGIC_MAX_SIZE ) {
1144 throw new IllegalArgumentException("byte array must be >= "+MAGIC_MAX_SIZE+", has "+b.length);
1145 }
1146 final byte b0 = b[0];
1147 final byte b1 = b[1];
1148 final byte b2 = b[2];
1149 final byte b3 = b[3];
1150 final byte b4 = b[4];
1151 final byte b5 = b[5];
1152
1153 // T_TGA: NO Signature!
1154
1155 if (b0 == (byte)0x00) {
1156 if (b1 == (byte)0x00 && b2 == (byte)0x00 && b3 == (byte)0x0C &&
1157 b4 == (byte)0x6A && b5 == (byte)0x50 &&
1158 b[6] == (byte)0x20 && b[7] == (byte)0x20 && b[8] == (byte)0x0D && b[9] == (byte)0x0A && b[10] == (byte)0x87 &&
1159 b[11] == (byte)0x0A) {
1160 return T_JP2;
1161 }
1162 else if (b1 == (byte)0x01) {
1163 return T_ICO;
1164 }
1165 else if (b1 == (byte)0x02) {
1166 return T_CUR;
1167 }
1168 }
1169 else if (b0 == (byte)0x01) {
1170 if (b1 == (byte)0xDA /* && b2 == (byte)0x01 && b3 == (byte)0x01 && b4 == (byte)0x00 && b5 == (byte)0x03 */) {
1171 return T_SGI_RGB;
1172 }
1173 else if (b1 == (byte)0xFF && b2 == (byte)0x02 && b3 == (byte)0x04 &&
1174 b4 == (byte)0x03 && b5 == (byte)0x02) {
1175 return T_DRW;
1176 }
1177 else if (b1 == (byte)0x00 && b2 == (byte)0x00 && b3 == (byte)0x00 &&
1178 b4 == (byte)0x58 && b5 == (byte)0x00 &&
1179 b[6] == (byte)0x00 && b[7] == (byte)0x00) {
1180 return T_EMF;
1181 }
1182 }
1183 else if (b0 == (byte)0x07 && b1 == (byte)0x20 && b2 == (byte)0x4D && b3 == (byte)0x4D) {
1184 return T_CAM;
1185 }
1186 else if (b0 == (byte)0x0A && b1 == (byte)0x05 && b2 == (byte)0x01 && b3 == (byte)0x08) {
1187 return T_PCX;
1188 }
1189 else if (b0 == (byte)0x1B && b1 == (byte)0x45 && b2 == (byte)0x1B && b3 == (byte)0x26 &&
1190 b4 == (byte)0x6C && b5 == (byte)0x30 &&
1191 b[6] == (byte)0x4F && b[7] == (byte)0x1B && b[8] == (byte)0x26 && b[9] == (byte)0x6C && b[10] == (byte)0x30 &&
1192 b[11] == (byte)0x45 && b[12] == (byte)0x1B && b[13] == (byte)0x26) {
1193 return T_PCL;
1194 }
1195 else if (b0 == (byte)0x20 && b1 == (byte)0x77 && b2 == (byte)0x00 && b3 == (byte)0x02) {
1196 return T_CBD;
1197 }
1198 else if (b0 == (byte)0x23) {
1199 if (b1 == (byte)0x20 && b2 == (byte)0x24 && b3 == (byte)0x49 &&
1200 b4 == (byte)0x64 && b5 == (byte)0x3A &&
1201 b[6] == (byte)0x20) {
1202 return T_SID;
1203 }
1204 else if (b1 == (byte)0x56 && b2 == (byte)0x52 && b3 == (byte)0x4D &&
1205 b4 == (byte)0x4C && b5 == (byte)0x20 &&
1206 b[6] == (byte)0x56 && b[7] == (byte)0x32 && b[8] == (byte)0x2E && b[9] == (byte)0x30) {
1207 return T_WRL;
1208 }
1209 else if (b1 == (byte)0x64 && b2 == (byte)0x65 && b3 == (byte)0x66 &&
1210 b4 == (byte)0x69 && b5 == (byte)0x6E &&
1211 b[6] == (byte)0x65) {
1212 return T_XBM;
1213 }
1214 }
1215 else if (b0 == (byte)0x2A && b1 == (byte)0x2A && b2 == (byte)0x54 && b3 == (byte)0x49 &&
1216 b4 == (byte)0x39 && b5 == (byte)0x32 &&
1217 b[6] == (byte)0x2A && b[7] == (byte)0x2A && b[8] == (byte)0x01 && b[9] == (byte)0x00 && b[10] == (byte)0x58 &&
1218 b[11] == (byte)0x6E && b[12] == (byte)0x56 && b[13] == (byte)0x69) {
1219 return T_92I;
1220 }
1221 else if (b0 == (byte)0x2F && b1 == (byte)0x2A && b2 == (byte)0x20 && b3 == (byte)0x58 &&
1222 b4 == (byte)0x50 && b5 == (byte)0x4D &&
1223 b[6] == (byte)0x20 && b[7] == (byte)0x2A && b[8] == (byte)0x2F) {
1224 return T_XPM;
1225 }
1226 else if (b0 == (byte)0x33 && b1 == (byte)0x44 && b2 == (byte)0x4D && b3 == (byte)0x46) {
1227 return T_3DMF;
1228 }
1229 else if (b0 == (byte)0x35 && b1 == (byte)0x4B && b2 == (byte)0x50 && b3 == (byte)0x35 &&
1230 b4 == (byte)0x31 && b5 == (byte)0x5D &&
1231 b[6] == (byte)0x2A && b[7] == (byte)0x67 && b[8] == (byte)0x72 && b[9] == (byte)0x72 && b[10] == (byte)0x80 &&
1232 b[11] == (byte)0x83 && b[12] == (byte)0x85 && b[13] == (byte)0x63) {
1233 return T_HRU;
1234 }
1235 else if (b0 == (byte)0x36 && b1 == (byte)0x34 && b2 == (byte)0x4C && b3 == (byte)0x41 &&
1236 b4 == (byte)0x4E && b5 == (byte)0x20 &&
1237 b[6] == (byte)0x49 && b[7] == (byte)0x44 && b[8] == (byte)0x42 && b[9] == (byte)0x4C && b[10] == (byte)0x4F &&
1238 b[11] == (byte)0x43 && b[12] == (byte)0x4B) {
1239 return T_L64;
1240 }
1241 else if (b0 == (byte)0x37 && b1 == (byte)0x00 && b2 == (byte)0x00 && b3 == (byte)0x10 &&
1242 b4 == (byte)0x42 && b5 == (byte)0x00 &&
1243 b[6] == (byte)0x00 && b[7] == (byte)0x10 && b[8] == (byte)0x00 && b[9] == (byte)0x00 && b[10] == (byte)0x00 &&
1244 b[11] == (byte)0x00 && b[12] == (byte)0x39 && b[13] == (byte)0x64) {
1245 return T_MBM;
1246 }
1247 else if (b0 == (byte)0x38 && b1 == (byte)0x42 && b2 == (byte)0x50 && b3 == (byte)0x53 &&
1248 b4 == (byte)0x00 && b5 == (byte)0x01 &&
1249 b[6] == (byte)0x00 && b[7] == (byte)0x00 && b[8] == (byte)0x00 && b[9] == (byte)0x00) {
1250 return T_PSD;
1251 }
1252 else if (b0 == (byte)0x3A && b1 == (byte)0xDE && b2 == (byte)0x68 && b3 == (byte)0xB1) {
1253 return T_DCX;
1254 }
1255 else if (b0 == (byte)0x3D && b1 == (byte)0x02) {
1256 return T_3D2;
1257 }
1258 else if (b0 == (byte)0x41) {
1259 if (b1 == (byte)0x43 && b2 == (byte)0x31 && b3 == (byte)0x30) {
1260 return T_DWG;
1261 }
1262 else if (b1 == (byte)0x48) {
1263 return T_PAL;
1264 }
1265 else if (b1 == (byte)0x4D && b2 == (byte)0x46 && b3 == (byte)0x46) {
1266 return T_AMFF;
1267 }
1268 else if (b1 == (byte)0x75 && b2 == (byte)0x74 && b3 == (byte)0x6F &&
1269 b4 == (byte)0x43 && b5 == (byte)0x41 &&
1270 b[6] == (byte)0x44 && b[7] == (byte)0x20 && b[8] == (byte)0x53 && b[9] == (byte)0x6C && b[10] == (byte)0x69 &&
1271 b[11] == (byte)0x64 && b[12] == (byte)0x65) {
1272 return T_SLD;
1273 }
1274 }
1275 else if (b0 == (byte)0x42 && b1 == (byte)0x4D) {
1276 if (b2 == (byte)0x36) {
1277 // FIXME: Collision or subtype of T_BMP?
1278 return T_DIB;
1279 } else {
1280 return T_BMP;
1281 }
1282 }
1283 else if (b0 == (byte)0x43) {
1284 if (b1 == (byte)0x36 && b2 == (byte)0x34) {
1285 return T_N64;
1286 }
1287 else if (b1 == (byte)0x41 && b2 == (byte)0x4C && b3 == (byte)0x41 &&
1288 b4 == (byte)0x4D && b5 == (byte)0x55 &&
1289 b[6] == (byte)0x53 && b[7] == (byte)0x43 && b[8] == (byte)0x56 && b[9] == (byte)0x47) {
1290 return T_CVG;
1291 }
1292 else if (b1 == (byte)0x50 && b2 == (byte)0x54 && b3 == (byte)0x46 &&
1293 b4 == (byte)0x49 && b5 == (byte)0x4C &&
1294 b[6] == (byte)0x45) {
1295 return T_CPT;
1296 }
1297 else if (b1 == (byte)0x61 && b2 == (byte)0x6C && b3 == (byte)0x69 &&
1298 b4 == (byte)0x67 && b5 == (byte)0x61 &&
1299 b[6] == (byte)0x72 && b[7] == (byte)0x69) {
1300 return T_COB;
1301 }
1302 }
1303 else if (b0 == (byte)0x44) {
1304 if (b1 == (byte)0x44 && b2 == (byte)0x53 && b3 == (byte)0x20) {
1305 return T_DDS;
1306 }
1307 else if (b1 == (byte)0x61 && b2 == (byte)0x6E && b3 == (byte)0x4D) {
1308 return T_MSP;
1309 }
1310 }
1311 else if (b0 == (byte)0x45) {
1312 if (b1 == (byte)0x59 && b2 == (byte)0x45 && b3 == (byte)0x53) {
1313 return T_CE2;
1314 }
1315 else if (b1 == (byte)0x78 && b2 == (byte)0x69 && b3 == (byte)0x66) { /* EXIF */
1316 /**
1317 * (b0 == (byte)0x45 && b1 == (byte)0x78 && b2 == (byte)0x69 && b3 == (byte)0x66) || // EXIF
1318 * (b0 == (byte)0x4A && b1 == (byte)0x46 && b2 == (byte)0x49 && b3 == (byte)0x46) || // JFIF
1319 * (b0 == (byte)0xff && b1 == (byte)0xd8 ) // && b2 == (byte)0xff
1320 */
1321 return T_JPG;
1322 }
1323 }
1324 else if (b0 == (byte)0x46 && b1 == (byte)0x4F && b2 == (byte)0x52 && b3 == (byte)0x4D) {
1325 if (b4 == (byte)0x41 && b5 == (byte)0x54 && b[6] == (byte)0x3D) {
1326 // FIXME: Collision or subtype of T_LBM?
1327 return T_RAD;
1328 } else {
1329 return T_LBM;
1330 }
1331 }
1332 else if (b0 == (byte)0x47 && b1 == (byte)0x49 && b2 == (byte)0x46 && b3 == (byte)0x38 &&
1333 (b4 == (byte)0x37 || b4 == (byte)0x39) && b5 == (byte)0x61) {
1334 return T_GIF;
1335 }
1336 else if (b0 == (byte)0x48 && b1 == (byte)0x50 && b2 == (byte)0x48 && b3 == (byte)0x50 &&
1337 b4 == (byte)0x34 && b5 == (byte)0x38 &&
1338 b[6] == (byte)0x2D && b[7] == (byte)0x45 && b[8] == (byte)0x1E && b[9] == (byte)0x2B) {
1339 return T_GRO;
1340 }
1341 else if (b0 == (byte)0x49) {
1342 if (b1 == (byte)0x49 && b2 == (byte)0x2A && b3 == (byte)0x00) {
1343 if (b4 == (byte)0x08 && b5 == (byte)0x00 &&
1344 b[6] == (byte)0x00 && b[7] == (byte)0x00 && b[8] == (byte)0x0E && b[9] == (byte)0x00 && b[10] == (byte)0x00 &&
1345 b[11] == (byte)0x01 && b[12] == (byte)0x04 && b[13] == (byte)0x00) {
1346 // FIXME: Collision or subtype of T_TIFF?
1347 return T_LDF;
1348 } else {
1349 return T_TIFF;
1350 }
1351 }
1352 else if (b1 == (byte)0x57 && b2 == (byte)0x43 && b3 == (byte)0x01) {
1353 return T_IWC;
1354 }
1355 }
1356 else if (b0 == (byte)0x4A) {
1357 if (b1 == (byte)0x46 && b2 == (byte)0x49 && b3 == (byte)0x46) { /* JFIF */
1358 /**
1359 * (b0 == (byte)0x45 && b1 == (byte)0x78 && b2 == (byte)0x69 && b3 == (byte)0x66) || // EXIF
1360 * (b0 == (byte)0x4A && b1 == (byte)0x46 && b2 == (byte)0x49 && b3 == (byte)0x46) || // JFIF
1361 * (b0 == (byte)0xff && b1 == (byte)0xd8 ) // && b2 == (byte)0xff
1362 */
1363 return T_JPG;
1364 }
1365 else if (b1 == (byte)0x47 && (b2 == (byte)0x03 || b2 == (byte)0x04) && b3 == (byte)0x0E &&
1366 b4 == (byte)0x00 && b5 == (byte)0x00 &&
1367 b[6] == (byte)0x00) {
1368 return T_ART;
1369 }
1370 else if (b1 == (byte)0x49 && b2 == (byte)0x46 && b3 == (byte)0x39 &&
1371 b4 == (byte)0x39 && b5 == (byte)0x61) {
1372 return T_JIF;
1373 }
1374 }
1375 else if (b0 == (byte)0x4D) {
1376 if (b1 == (byte)0x47 && b2 == (byte)0x4C) {
1377 return T_MGL;
1378 }
1379 else if (b1 == (byte)0x4D && b2 == (byte)0x00 && b3 == (byte)0x2A) {
1380 return T_KDC;
1381 }
1382 else if (b1 == (byte)0x50 && b2 == (byte)0x46) {
1383 return T_MPW;
1384 }
1385 }
1386 else if (b0 == (byte)0x4E) {
1387 if (b1 == (byte)0x47 && b2 == (byte)0x47 && b3 == (byte)0x00 &&
1388 b4 == (byte)0x01 && b5 == (byte)0x00) {
1389 return T_NGG;
1390 }
1391 else if (b1 == (byte)0x4C && b2 == (byte)0x4D && b3 == (byte)0x20 &&
1392 b4 == (byte)0x01 && b5 == (byte)0x02 &&
1393 b[6] == (byte)0x00) {
1394 return T_NLM;
1395 }
1396 else if (b1 == (byte)0x4F && b2 == (byte)0x4C && b3 == (byte)0x00 &&
1397 b4 == (byte)0x01 && b5 == (byte)0x00 &&
1398 b[6] == (byte)0x06 && b[7] == (byte)0x01 && b[8] == (byte)0x03 && b[9] == (byte)0x00) {
1399 return T_NOL;
1400 }
1401 }
1402 else if (b0 == (byte)0x50) {
1403 if (b1 == (byte)0x31 /* plain */|| b1 == (byte)0x34) {
1404 return T_PBM;
1405 }
1406 else if (b1 == (byte)0x32 /* plain */|| b1 == (byte)0x35) {
1407 return T_PGM;
1408 }
1409 else if (b1 == (byte)0x33 /* plain */|| b1 == (byte)0x36) {
1410 return T_PPM;
1411 }
1412 else if (b1 == (byte)0x37) {
1413 return T_PAM;
1414 }
1415 else if (b1 == (byte)0x41 && b2 == (byte)0x58) {
1416 return T_PAX;
1417 }
1418 else if (b1 == (byte)0x49 && b2 == (byte)0x58 && b3 == (byte)0x20) {
1419 return T_PIX;
1420 }
1421 else if (b1 == (byte)0x4F && b2 == (byte)0x4C && b3 == (byte)0x20 &&
1422 b4 == (byte)0x46 && b5 == (byte)0x6F &&
1423 b[6] == (byte)0x72 && b[7] == (byte)0x6D && b[8] == (byte)0x61 && b[9] == (byte)0x74) {
1424 return T_POL;
1425 }
1426 else if (b1 == (byte)0x61 && b2 == (byte)0x69 && b3 == (byte)0x6E &&
1427 b4 == (byte)0x74 && b5 == (byte)0x20 &&
1428 b[6] == (byte)0x53 && b[7] == (byte)0x68 && b[8] == (byte)0x6F && b[9] == (byte)0x70 && b[10] == (byte)0x20 &&
1429 b[11] == (byte)0x50 && b[12] == (byte)0x72 && b[13] == (byte)0x6F && b[14] == (byte)0x20 && b[15] == (byte)0x49 &&
1430 b[16] == (byte)0x6D && b[17] == (byte)0x61 && b[18] == (byte)0x67 && b[19] == (byte)0x65 && b[20] == (byte)0x20 &&
1431 b[21] == (byte)0x46 && b[22] == (byte)0x69 && b[23] == (byte)0x6C && b[24] == (byte)0x65) {
1432 return T_PSP;
1433 }
1434 }
1435 else if (b0 == (byte)0x51 && b1 == (byte)0x4C && b2 == (byte)0x49 && b3 == (byte)0x49 &&
1436 b4 == (byte)0x46 && b5 == (byte)0x41 &&
1437 b[6] == (byte)0x58) {
1438 return T_QFX;
1439 }
1440 else if (b0 == (byte)0x52 && b1 == (byte)0x49 && b2 == (byte)0x58 && b3 == (byte)0x33) {
1441 return T_RIX;
1442 }
1443 else if (b0 == (byte)0x53) {
1444 if (b1 == (byte)0x44 && b2 == (byte)0x50 && b3 == (byte)0x58) {
1445 return T_DPX;
1446 }
1447 else if (b1 == (byte)0x49 && b2 == (byte)0x4D && b3 == (byte)0x50 &&
1448 b4 == (byte)0x4C && b5 == (byte)0x45 &&
1449 b[6] == (byte)0x20 && b[7] == (byte)0x20 && b[8] == (byte)0x3D) {
1450 return T_FTS;
1451 }
1452 else if (b1 == (byte)0x74 && b2 == (byte)0x6F && b3 == (byte)0x72 &&
1453 b4 == (byte)0x6D && b5 == (byte)0x33 &&
1454 b[6] == (byte)0x44) {
1455 return T_SOD;
1456 }
1457 else if (b1 == (byte)0x80 && b2 == (byte)0xf6 && b3 == (byte)0x34) {
1458 return T_PIC;
1459 }
1460 }
1461 else if (b0 == (byte)0x56 && b1 == (byte)0x69 && b2 == (byte)0x73 && b3 == (byte)0x74 &&
1462 b4 == (byte)0x61 && b5 == (byte)0x20 &&
1463 b[6] == (byte)0x44 && b[7] == (byte)0x45 && b[8] == (byte)0x4D && b[9] == (byte)0x20 && b[10] == (byte)0x46 &&
1464 b[11] == (byte)0x69 && b[12] == (byte)0x6C && b[13] == (byte)0x65) {
1465 return T_DEM;
1466 }
1467 else if (b0 == (byte)0x57 && b1 == (byte)0x56 && b2 == (byte)0x02 && b3 == (byte)0x00 &&
1468 b4 == (byte)0x47 && b5 == (byte)0x45 &&
1469 b[6] == (byte)0x00 && b[7] == (byte)0x0E) {
1470 return T_LWF;
1471 }
1472 else if (b0 == (byte)0x59 && b1 == (byte)0xA6 && b2 == (byte)0x6A && b3 == (byte)0x95) {
1473 return T_RAS;
1474 }
1475 else if (b0 == (byte)0x63 && b1 == (byte)0x52 && b2 == (byte)0x01 && b3 == (byte)0x01 &&
1476 b4 == (byte)0x38 && b5 == (byte)0x09 &&
1477 b[6] == (byte)0x3D && b[7] == (byte)0x00) {
1478 return T_PCD;
1479 }
1480 else if (b0 == (byte)0x65) {
1481 if (b1 == (byte)0x02 && b2 == (byte)0x01 && b3 == (byte)0x02) {
1482 return T_ECW;
1483 }
1484 else if (b1 == (byte)0x6C && b2 == (byte)0x6D && b3 == (byte)0x6F) {
1485 return T_INFINI_D;
1486 }
1487 }
1488 else if (b0 == (byte)0x69 && b1 == (byte)0x63 && b2 == (byte)0x6E && b3 == (byte)0x73) {
1489 return T_ICNS;
1490 }
1491 else if (b0 == (byte)0x6D && b1 == (byte)0x6F && b2 == (byte)0x6F && b3 == (byte)0x76) {
1492 return T_QTM;
1493 }
1494 else if (b0 == (byte)0x6E) {
1495 if (b1 == (byte)0x63 && b2 == (byte)0x6F && b3 == (byte)0x6C &&
1496 b4 == (byte)0x73) {
1497 return T_HDR;
1498 }
1499 else if (b1 == (byte)0x66 && b2 == (byte)0x66) {
1500 return T_NFF;
1501 }
1502 else if (b1 == (byte)0x6E && b2 == (byte)0x0A && b3 == (byte)0x00 &&
1503 b4 == (byte)0x5E && b5 == (byte)0x00) {
1504 return T_NCR;
1505 }
1506 }
1507 else if (b0 == (byte)0x73 && b1 == (byte)0x72 && b2 == (byte)0x63 && b3 == (byte)0x64 &&
1508 b4 == (byte)0x6F && b5 == (byte)0x63 &&
1509 b[6] == (byte)0x69 && b[7] == (byte)0x64 && b[8] == (byte)0x3A) {
1510 return T_CALS;
1511 }
1512 else if (b0 == (byte)0x7B && b1 == (byte)0x0A && b2 == (byte)0x20 && b3 == (byte)0x20 &&
1513 b4 == (byte)0x43 && b5 == (byte)0x72 &&
1514 b[6] == (byte)0x65 && b[7] == (byte)0x61 && b[8] == (byte)0x74 && b[9] == (byte)0x65 && b[10] == (byte)0x64) {
1515 return T_MIF;
1516 }
1517 else if (b0 == (byte)0x7E && b1 == (byte)0x42 && b2 == (byte)0x4B && b3 == (byte)0x00) {
1518 return T_PSP;
1519 }
1520 else if (b0 == (byte)0x80) {
1521 if (b1 == (byte)0x2A && b2 == (byte)0x5F && b3 == (byte)0xD7 &&
1522 b4 == (byte)0x00 && b5 == (byte)0x00 &&
1523 b[6] == (byte)0x08 && b[7] == (byte)0x00 && b[8] == (byte)0x00 && b[9] == (byte)0x00 && b[10] == (byte)0x04 &&
1524 b[11] == (byte)0x00 && b[12] == (byte)0x00 && b[13] == (byte)0x00) {
1525 return T_CIN;
1526 }
1527 else if (b1 == (byte)0x3E && b2 == (byte)0x44 && b3 == (byte)0x53 &&
1528 b4 == (byte)0x43 && b5 == (byte)0x49 &&
1529 b[6] == (byte)0x4D) {
1530 return T_J6I;
1531 }
1532 }
1533 else if (b0 == (byte)0x89 && b1 == (byte)0x50 && b2 == (byte)0x4E && b3 == (byte)0x47 && /* 'P' 'N' 'G', ascii code */
1534 b4 == (byte)0x0D && b5 == (byte)0x0A && b[6] == (byte)0x1A && b[7] == (byte)0x0A) {
1535 // -119, 80, 78, 71, 13, 10, 26, 10
1536 return T_PNG;
1537 }
1538 else if (b0 == (byte)0x8A && b1 == (byte)0x4D && b2 == (byte)0x4E && b3 == (byte)0x47 &&
1539 b4 == (byte)0x0D && b5 == (byte)0x0A &&
1540 b[6] == (byte)0x1A && b[7] == (byte)0x0A) {
1541 return T_MNG;
1542 }
1543 else if (b0 == (byte)0xD0 && b1 == (byte)0xCF && b2 == (byte)0x11 && b3 == (byte)0xE0 &&
1544 b4 == (byte)0xA1 && b5 == (byte)0xB1 &&
1545 b[6] == (byte)0x1A && b[7] == (byte)0xE1 && b[8] == (byte)0x00) {
1546 return T_FPX;
1547 }
1548 else if (b0 == (byte)0xD3 && b1 == (byte)0x23 && b2 == (byte)0x00 && b3 == (byte)0x00 &&
1549 b4 == (byte)0x03 && b5 == (byte)0x00 &&
1550 b[6] == (byte)0x00 && b[7] == (byte)0x00) {
1551 return T_WLM;
1552 }
1553 else if (b0 == (byte)0xD7 && b1 == (byte)0xCD && b2 == (byte)0xC6 && b3 == (byte)0x9A) {
1554 return T_WMF;
1555 }
1556 else if (b0 == (byte)0xEB && b1 == (byte)0x3C && b2 == (byte)0x90 && b3 == (byte)0x2A) {
1557 return T_IMG;
1558 }
1559 else if (b0 == (byte)0xFA && b1 == (byte)0xDE && b2 == (byte)0xBA && b3 == (byte)0xBE &&
1560 b4 == (byte)0x01 && b5 == (byte)0x01) {
1561 return T_WIC;
1562 }
1563 else if (b0 == (byte)0xFF) {
1564 if (b1 == (byte)0xD8 /* && b2 == (byte)0xff */) {
1565 /**
1566 * (b0 == (byte)0x45 && b1 == (byte)0x78 && b2 == (byte)0x69 && b3 == (byte)0x66) || // EXIF
1567 * (b0 == (byte)0x4A && b1 == (byte)0x46 && b2 == (byte)0x49 && b3 == (byte)0x46) || // JFIF
1568 * (b0 == (byte)0xff && b1 == (byte)0xd8 ) // && b2 == (byte)0xff
1569 */
1570 return T_JPG;
1571 }
1572 else if (b1 == (byte)0x57 && b2 == (byte)0x50 && b3 == (byte)0x43 && b4 == (byte)0x10) {
1573 return T_WPG;
1574 }
1575 }
1576 return null;
1577 }
1578 }
1579}
Static utility functions for ImageType to determine the ImageType#type.
static String getFileSuffix(InputStream stream, final byte[] b)
Determines the file suffix (i.e the image format) of the given InputStream.
static String getFileSuffix(final InputStream stream)
Determines the file suffix (i.e the image format) of the given InputStream.
static String getFileSuffix(final byte[] b)
Determines the file suffix (i.e the image format) of the given bytes from the header of a file.
Image type classification.
Definition: ImageType.java:42
static final String T_WPG
Constant which can be used as a file suffix to indicate a Wordperfect Graphics vectors stream,...
Definition: ImageType.java:974
static final String T_JIF
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:565
static final String T_FPX
Constant which can be used as a file suffix to indicate a FlashPix stream, value {@value}.
Definition: ImageType.java:466
static final String T_GIF
Constant which can be used as a file suffix to indicate a GIF stream, value {@value}.
Definition: ImageType.java:107
static final String T_LDF
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:198
static final String T_DPX
Constant which can be used as a file suffix to indicate a Digital Picture Exchange stream,...
Definition: ImageType.java:411
static final String T_PSP
Constant which can be used as a file suffix to indicate a PaintShop Pro stream, value {@value}.
Definition: ImageType.java:851
static final String T_WLM
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:952
static final String T_QTM
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:873
static final String T_N64
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:708
static final String T_MNG
Constant which can be used as a file suffix to indicate a Multiple-image Network Graphics stream,...
Definition: ImageType.java:675
static final String T_CPT
Constant which can be used as a file suffix to indicate a Corel Photo Paint stream,...
Definition: ImageType.java:377
static final String T_POL
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:840
ImageType(final InputStream stream)
Creates instance based on given stream.
static final String T_PCL
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:807
static final String T_JP2
Constant which can be used as a file suffix to indicate a JPEG-2000 stream, value {@value}.
Definition: ImageType.java:576
static final String T_3D2
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:255
ImageType(final String type)
Creates instance based on the given type.
static final String T_PIC
Constant which can be used as a file suffix to indicate a Softimage pic stream, value {@value}.
Definition: ImageType.java:818
static final String T_LWF
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:631
static final String T_DWG
Constant which can be used as a file suffix to indicate a Autocad drawing stream, value {@value}.
Definition: ImageType.java:433
static final String T_COB
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:366
static final String T_NLM
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:752
static final String T_3DMF
Constant which can be used as a file suffix to indicate an Apple QuickDraw 3D 3DMF stream,...
Definition: ImageType.java:266
static final String T_HRU
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:510
static final String T_XBM
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:996
static final String T_INFINI_D
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:532
static final String T_IWC
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:543
static final String T_XPM
Constant which can be used as a file suffix to indicate a X PixMap stream, value {@value}.
static final String T_PCD
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:796
static final String T_DEM
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:400
static final String T_NCR
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:719
static final String T_TGA
Constant which can be used as a file suffix to indicate a Targa stream, value {@value}.
static final String T_J6I
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:554
static final String T_AMFF
Constant which can be used as a file suffix to indicate an Amiga metafile stream, value {@value}.
Definition: ImageType.java:288
static final String T_RAD
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:620
static final String T_SOD
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:929
static final String T_RIX
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:895
static final String T_GRO
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:488
static final String T_CAM
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:321
final boolean isDefined()
Returns true if type is determined, i.e.
static final String T_CVG
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:388
static final String T_DCX
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:143
static final String T_WMF
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:963
static final String T_RAS
Constant which can be used as a file suffix to indicate a Sun Raster stream, value {@value}.
Definition: ImageType.java:884
static final String T_PSD
Constant which can be used as a file suffix to indicate a Adobe PhotoShop stream, value {@value}.
Definition: ImageType.java:173
static final String T_L64
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:598
static final String T_SGI_RGB
Constant which can be used as a file suffix to indicate an SGI RGB stream, value {@value}.
Definition: ImageType.java:209
static final String T_92I
Constant which can be used as a file suffix to indicate a Texas Instruments TI-92 Bitmap stream,...
Definition: ImageType.java:277
static final String T_QFX
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:862
static final String T_SID
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:906
static final String T_SLD
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:917
static final String T_ICO
Constant which can be used as a file suffix to indicate a Microsoft Windows Icon stream,...
Definition: ImageType.java:85
static final String T_DIB
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:132
static final int MAGIC_MAX_SIZE
Minimum number of bytes to determine the image data type, i.e.
Definition: ImageType.java:46
static final String T_PBM
Constant which can be used as a file suffix to indicate a PGM stream, NetPbm magic 4 - binary monochr...
Definition: ImageType.java:244
static final String T_PPM
Constant which can be used as a file suffix to indicate a PAM stream, NetPbm magic 6 - binary RGB.
Definition: ImageType.java:162
static final String T_PNG
Constant which can be used as a file suffix to indicate a PNG stream, value {@value}.
Definition: ImageType.java:63
static final String T_CIN
Constant which can be used as a file suffix to indicate a Kodak Cineon System stream,...
Definition: ImageType.java:355
static final String T_PGM
Constant which can be used as a file suffix to indicate a PGM stream, NetPbm magic 5 - binary graysca...
Definition: ImageType.java:236
static final String T_LBM
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:609
static final String T_MSP
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:697
static final String T_PAL
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:774
static final String T_TIFF
Constant which can be used as a file suffix to indicate a TIFF stream, value {@value}.
Definition: ImageType.java:187
static final String T_CALS
Constant which can be used as a file suffix to indicate a United States Department of Defence Continu...
Definition: ImageType.java:310
final String type
The determined unique type, e.g.
static final String T_MBM
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:642
static final String T_CBD
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:332
final byte[] header
The optionally read header of size MAGIC_MAX_SIZE bytes as used to determine the type,...
static final String T_MIF
Constant which can be used as a file suffix to indicate an Imagemagick stream, value {@value}.
Definition: ImageType.java:664
static final String T_HDR
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:499
static final String T_IMG
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:521
static final String T_FTS
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:477
static final String T_PAM
Constant which can be used as a file suffix to indicate a Portable Arbitrary Map stream,...
Definition: ImageType.java:228
static final String T_MPW
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:686
static final String T_PCX
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:154
static final String T_WRL
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:985
static final String T_NGG
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:741
static final String T_DRW
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:422
static final String T_ICNS
Constant which can be used as a file suffix to indicate an Apple Icon Image stream,...
Definition: ImageType.java:74
static final String T_DDS
Constant which can be used as a file suffix to indicate a DirectDraw Surface stream,...
Definition: ImageType.java:220
static final String T_NOL
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:763
static final String T_WIC
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:941
static final String T_CE2
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:344
static final String T_PIX
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:829
static final String T_ECW
Constant which can be used as a file suffix to indicate a Hexagon Geospatial Enhanced Compression Wav...
Definition: ImageType.java:444
static final String T_PAX
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:785
static final String T_MGL
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:653
static final String T_BMP
Constant which can be used as a file suffix to indicate a GIF stream, value {@value}.
Definition: ImageType.java:121
static final String T_KDC
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:587
static final String T_ART
Constant which can be used as a file suffix to indicate an America Online Art stream,...
Definition: ImageType.java:299
static final String T_CUR
Constant which can be used as a file suffix to indicate a Microsoft Windows Cursor stream,...
Definition: ImageType.java:96
static final String T_JPG
Constant which can be used as a file suffix to indicate a JPEG stream, value {@value}.
Definition: ImageType.java:55
static final String T_NFF
Constant which can be used as a file suffix to indicate a TBD stream, value {@value}.
Definition: ImageType.java:730
static final String T_EMF
Constant which can be used as a file suffix to indicate a Microsoft Windows Enhanced metafile stream,...
Definition: ImageType.java:455