Reputation: 608
How to retain the resolution of an image while reducing or expanding... Is there a way...
Upvotes: 0
Views: 156
Reputation: 75257
You shoould check here, same problem exists:
http://forums.oracle.com/forums/thread.jspa?threadID=1270008
Solution offered there:
TIFFEncodeParam tep = new TIFFEncodeParam();
// Create {X,Y}Resolution fields.
TIFFField fieldXRes = new TIFFField(0x11A, TIFFField.TIFF_RATIONAL,
1, new long[][] {{DPI_X, 1}});
TIFFField fieldYRes = new TIFFField(0x11B, TIFFField.TIFF_RATIONAL,
1, new long[][] {{DPI_Y, 1}});
tep.setExtraFields(new TIFFField[] {fieldXRes, fieldYRes});
Upvotes: 2