2013-06-20 37 views
6

我的工作例如:替代GAE上的ImageIO類?在正常J2EE應用

// decode the image 
    InputStream inputStream = new File("/images/test.png"); 
    BufferedImage barCodeBufferedImage = ImageIO.read(inputStream); 
    if (barCodeBufferedImage != null) { 
     LuminanceSource source = new BufferedImageLuminanceSource(barCodeBufferedImage); 
     BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source)); 
     Result results = new MultiFormatReader().decode(bitmap); 
     //System.out.println("Decoded barcode image :: "+results.getText()); 
     return results.getText(); 
    } 

同樣我想在GAE實現。但它會阻止ImageIO類和BufferedImage類。 任何人都可以告訴我在GAE上的ImageIO類的替代?

+0

可能的重複[如何在谷歌appengine中使用java讀取圖片url](https://stackoverflow.com/questions/6856552/how-to-read-a-image-url-in-google-appengine-使用的Java) – Suma

回答

1

Google App Engine具有一組有限的圖像API,您可以在其中找到here的文檔。

基本操作包括裁剪,旋轉,翻轉,調整大小和一些顏色操作。

靜態makeImage方法將從字節數組構建一個圖像。