File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
io/src/test/java/com/itextpdf/io/image Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,6 @@ This file is part of the iText (R) project.
40
40
For more information, please contact iText Software Corp. at this
41
41
42
42
*/
43
-
44
43
package com .itextpdf .io .image ;
45
44
46
45
import com .itextpdf .io .util .StreamUtil ;
@@ -51,16 +50,18 @@ This file is part of the iText (R) project.
51
50
52
51
import java .io .FileInputStream ;
53
52
import java .io .IOException ;
53
+
54
54
@ Category (UnitTest .class )
55
55
public class GifTest {
56
56
public static final String sourceFolder = "./src/test/resources/com/itextpdf/io/image/" ;
57
57
58
58
@ Test
59
59
public void gifImageTest () throws IOException {
60
- byte [] fileContent = StreamUtil .inputStreamToArray ( new FileInputStream ( sourceFolder +"WP_20140410_001.gif" ) );
61
- ImageData img = ImageDataFactory .create ( fileContent , false );
62
- Assert .assertTrue ( img .isRawImage () );
63
- Assert .assertEquals ( ImageType .GIF , img .getOriginalType () );
64
-
60
+ try (FileInputStream file = new FileInputStream (sourceFolder + "WP_20140410_001.gif" )) {
61
+ byte [] fileContent = StreamUtil .inputStreamToArray (file );
62
+ ImageData img = ImageDataFactory .create (fileContent , false );
63
+ Assert .assertTrue (img .isRawImage ());
64
+ Assert .assertEquals (ImageType .GIF , img .getOriginalType ());
65
+ }
65
66
}
66
67
}
You can’t perform that action at this time.
0 commit comments