Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

StdQTConstants.kQTFileTypeGIF



hi list,

getting a strange error when i try to do this:
method for returning the constant for a mimetype (this is a web
application)

public static int constantForMimeType(String mimeType) {
log.debug("mime type. " + mimeType);
if (mimeType.equals("image/bmp"))
return quicktime.std.StdQTConstants.kQTFileTypeBMP;
else if (mimeType.equals("image/gif"))
return quicktime.std.StdQTConstants.kQTFileTypeGIF;
else if (mimeType.equals("image/jpeg"))
return quicktime.std.StdQTConstants.kQTFileTypeJPEG;
else if (mimeType.equals("image/png"))
return quicktime.std.StdQTConstants4.kQTFileTypePNG;
else if (mimeType.equals("image/tiff"))
return quicktime.std.StdQTConstants4.kQTFileTypeTIFF;
else
return quicktime.std.StdQTConstants.kQTFileTypeJPEG;
}

and here i try to do some scaling


public static NSData resizeWithWidthAndHeight(NSData imageData, int
width, int height, int QTFileConstant) {
NSData scaledData = null;

byte[] bytes = imageData.bytes();
try {
QTHandle qtHandle = new QTHandle(bytes);
DataRef dataRef = new DataRef(qtHandle);
GraphicsImporter graphicsImporter = new
GraphicsImporter(dataRef);
QDRect bounds = graphicsImporter.getNaturalBounds();
QDRect newBounds = new QDRect(width, height);
graphicsImporter.setBoundsRect(newBounds);
GraphicsExporter graphicsExporter = new
GraphicsExporter(QTFileConstant);
graphicsExporter.setInputGraphicsImporter(graphicsImporter);
QTHandle outHandle = new QTHandle();
graphicsExporter.setOutputHandle(outHandle);
graphicsExporter.doExport();
scaledData = new NSData(outHandle.getBytes());
}
catch (Exception e) {
log.warn("image resize failed with: " + e );
}
return scaledData;
}

here is the error i get:

image resize failed with:
quicktime.std.StdQTException[QTJava:6.0.0g2],-
2003=cantFindHandler,QT.vers:6108000

this happens for gif images only

any suggestions?

cornelius
Cornelius Jaeger - Member of Visual FOOD GmbH
http://www.visualfood.ch
Moosstrasse 7
CH-6003 Luzern
Fon: + 41 41 21 0 21 41
Fax: + 41 41 21 0 21 43
_______________________________________________
quicktime-java mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/quicktime-java
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.