[appengine-java] Re: ImagesServiceFactory.makeImageFromBlob(blobKey) > image.getImageData() > gets NULL error >

2011-03-25 Thread branflake2267
Scale your image on the client side. GWT/HTML has many options to work with 
and I'm in love with that!

http://code.google.com/p/gwt-examples/wiki/gwt_hmtl5

Brandon Donnelson
http://gwt-examples.googlecode.com
http://c.gawkat.com

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: ImagesServiceFactory.makeImageFromBlob(blobKey) > image.getImageData() > gets NULL error >

2011-03-22 Thread branflake2267
I'm going to try to get the job done with HTML5 for now, until the server 
has the features to do the job.

http://google-web-toolkit.googlecode.com/svn/javadoc/latest/index.html?overview-summary.html

http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#images

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: ImagesServiceFactory.makeImageFromBlob(blobKey) > image.getImageData() > gets NULL error >

2011-03-21 Thread branflake2267
I get the correct byte count reading it this way:

   private byte[] getImageBytes(BlobData blobData) {

if (blobData == null) {

  return null;

}

  

BlobKey blobKey = new BlobKey(blobData.getKey());

if (blobKey == null) {

  return null;

}



long filesize = blobData.getSize();

long chunkSize = 1024;

long startIndex = 0;

long endIndex = chunkSize;



ByteArrayOutputStream out = new ByteArrayOutputStream();

if (filesize > 1024) {


  boolean theend = false;

  while (theend == false) {

if (endIndex == filesize) {

  theend = true;

}



System.out.println("startIndex=" + startIndex + " endIndex=" + 
endIndex);



byte[] b = blobstoreService.fetchData(blobKey, startIndex, 
endIndex);

try {

  out.write(b);

} catch (IOException e) {

  e.printStackTrace();

}



startIndex = endIndex + 1;

endIndex = startIndex + chunkSize;

if (endIndex > filesize) {

  endIndex = filesize;

}

  }

  

} else {

  byte[] b = blobstoreService.fetchData(blobKey, 0, 1024);

  try {

out.write(b);

  } catch (IOException e) {

e.printStackTrace();

  }

}



byte[] filebytes = out.toByteArray();



System.out.println("getImageBytes(): filebytes size: " + filebytes.
length + " blobData.size=" + blobData.getSize());



return filebytes;

  }

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: ImagesServiceFactory.makeImageFromBlob(blobKey) > image.getImageData() > gets NULL error >

2011-03-21 Thread branflake2267
I think my problem is in reading the bytes into the array. Oh, if this is 
it, I'm been barking up the wrong tree.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: ImagesServiceFactory.makeImageFromBlob(blobKey) > image.getImageData() > gets NULL error >

2011-03-21 Thread branflake2267
I keep getting this error reading data from the blob. 

   [ERROR] createTiles(): Error: java.lang.IllegalArgumentException: 
corruptJPEG 
format

  java.lang.IllegalArgumentException: corrupt JPEG format


atcom.google.appengine.api.images.ImageImpl.updateJpegDimensions(ImageImpl.java
:261)

atcom.google.appengine.api.images.ImageImpl.updateDimensions(ImageImpl.java
:146)

at com.google.appengine.api.images.ImageImpl.getWidth(ImageImpl.java:55)


atorg.gonevertical.core.server.service.image.Ga_Service_Image.createTiles(Ga_Service_Image.java
:250)


atorg.gonevertical.core.server.service.image.Ga_Service_Image.tileImage(Ga_Service_Image.java
:240)


atorg.gonevertical.core.server.service.image.Ga_Service_Image.tile(Ga_Service_Image.java
:229)


atorg.gonevertical.core.server.service.image.Ga_Service_Image.transform(Ga_Service_Image.java
:174)


atorg.gonevertical.core.server.servlet.Servlet_Task.startTransform(Servlet_Task.java
:127)

atorg.gonevertical.core.server.servlet.Servlet_Task.doGet(Servlet_Task.java
:84)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
511)


atorg.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java
:1166)


atcom.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java
:58)


atorg.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java
:1157)


atcom.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java
:43)


atorg.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java
:1157)


atcom.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java
:122)


atorg.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java
:1157)

at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
388)

atorg.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java
:216)

at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
182)

at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
765)

at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)


atcom.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java
:70)

at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)


atcom.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java
:351)

at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)

at org.mortbay.jetty.Server.handle(Server.java:326)

at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
542)


atorg.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java
:923)

at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)

at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)

at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)

atorg.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java
:409)

atorg.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java
:582)



This is how I am reading the image bytes:

private byte[] getImageBytes(BlobData blobData) {

if (blobData == null) {

  return null;

}

  

BlobKey blobKey = new BlobKey(blobData.getKey());

if (blobKey == null) {

  return null;

}

   

int chunkSize = 1024;

long startIndex = 0;

long endIndex = chunkSize;

long filesize = blobData.getSize();

boolean theend = false;

ByteArrayOutputStream out = new ByteArrayOutputStream();

while (theend == false) {

  if (endIndex == filesize) {

theend = true;

  }

  

  System.out.println("startIndex=" + startIndex + " endIndex=" + 
endIndex);

  

  byte[] b = blobstoreService.fetchData(blobKey, startIndex, endIndex);

  try {

out.write(b);

  } catch (IOException e) {

e.printStackTrace();

  }

  

  startIndex = startIndex + chunkSize;

  endIndex = endIndex + chunkSize;

  if (endIndex >filesize) {

endIndex = filesize;

  }

} 



byte[] filebytes = out.toByteArray();



return filebytes;

  }

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: ImagesServiceFactory.makeImageFromBlob(blobKey) > image.getImageData() > gets NULL error >

2011-03-21 Thread branflake2267
Need an Image Service Api Roadmap to new features scheduled to be added.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: ImagesServiceFactory.makeImageFromBlob(blobKey) > image.getImageData() > gets NULL error >

2011-03-21 Thread branflake2267
Need Exif methods.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: ImagesServiceFactory.makeImageFromBlob(blobKey) > image.getImageData() > gets NULL error >

2011-03-21 Thread branflake2267
Need a testImageEncoding() to verify its a good image.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: ImagesServiceFactory.makeImageFromBlob(blobKey) > image.getImageData() > gets NULL error >

2011-03-21 Thread branflake2267
Here is what I'd shoot for having app engine do on the server side, just 
like HTML5 could do on the client side.

http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#images


-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: ImagesServiceFactory.makeImageFromBlob(blobKey) > image.getImageData() > gets NULL error >

2011-03-20 Thread branflake2267
This won't work either. I get the same funky colors. So far I think the 
cropping does not work at all. 

leftX = .05D; 
topY = .05D; 
rightX = .10D; 
bottomY = .10D; 

oldImage = ImagesServiceFactory.makeImageFromBlob(new 
BlobKey(fd.getBlobData().getKey())); 
Transform transform = ImagesServiceFactory.makeCrop(leftX, topY, rightX, 
bottomY); 

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: ImagesServiceFactory.makeImageFromBlob(blobKey) > image.getImageData() > gets NULL error >

2011-03-20 Thread branflake2267
This won't work:

I can't figure out yet why I getting funky colors while cropping an image 
both on the dev and production side. 

For the file uploaded:
Transform transform = ImagesServiceFactory.makeCrop(0, 0, .10, .10);
Image newImage = imagesService.applyTransform(transform, oldImage);

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: ImagesServiceFactory.makeImageFromBlob(blobKey) > image.getImageData() > gets NULL error >

2011-03-20 Thread branflake2267
It appears I made have spoke to soon about loading the byte data in making 
an image and using that to transform. I'm having a problem with cropping. It 
crops but the image is funky colored. 

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: ImagesServiceFactory.makeImageFromBlob(blobKey) > image.getImageData() > gets NULL error >

2011-03-20 Thread branflake2267
Another note:

You can use any pure java readers on the market due to dependencies:

http://code.google.com/appengine/forum/java-forum.html?place=topic%2Fgoogle-appengine-java%2F61pBMzfv7QU%2Fdiscussion

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: ImagesServiceFactory.makeImageFromBlob(blobKey) > image.getImageData() > gets NULL error >

2011-03-20 Thread branflake2267
Issue created:

http://code.google.com/p/googleappengine/issues/detail?id=2990&q=image%20service&colspec=ID%20Type%20Component%20Status%20Stars%20Summary%20Language%20Priority%20Owner%20Log

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: ImagesServiceFactory.makeImageFromBlob(blobKey) > image.getImageData() > gets NULL error >

2011-03-20 Thread branflake2267
Another thing you can't do with the image api. So far, I can't make an image 
from byte data and resize it. Dang!

   Transform resize = ImagesServiceFactory.makeResize(resizeWidth.intValue(), 
resizeHeight.intValue());

oldImage = ImagesServiceFactory.makeImage(oldImage.getImageData());

Image newImage = imagesService.applyTransform(resize, oldImage);


Brandon Donnelson

http://c.gawkat.com

http://gwt-examples.googlecode.com

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: ImagesServiceFactory.makeImageFromBlob(blobKey) > image.getImageData() > gets NULL error >

2011-03-20 Thread branflake2267
Tiling an image, (mapping it) is a challenge with a percentage, due to 
precision, or my perceived precision of division of the image. I figured out 
a work around I think using different math to divide it up to have a precise 
division that so no overlapping occurs. But to my point, I believe using a 
make crop with pixels would be nice. I still can do the job.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: ImagesServiceFactory.makeImageFromBlob(blobKey) > image.getImageData() > gets NULL error >

2011-03-20 Thread branflake2267
Another image service request:

ImageServiceFactory.makeCrop(..) - uses percentage parameters. I'd like a 
exact pixel (px) parameters.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: ImagesServiceFactory.makeImageFromBlob(blobKey) > image.getImageData() > gets NULL error >

2011-03-19 Thread branflake2267
One more note:

It would be nice to watermark my images with the api.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: ImagesServiceFactory.makeImageFromBlob(blobKey) > image.getImageData() > gets NULL error >

2011-03-19 Thread branflake2267
The image service has limitations. It won't allow to resize a width thats > 
4000px. The image service is for light duty small images. The current 
cameras on the market are producing very large images and scaling them is 
trouble some. I have panoramic images, where the widths are gigantic and 
this image service isn't cutting it. I suggest adding some beaf to the image 
service please :). I would think that this is a core function that spans 
most applications, and more beaf to it would conserve resources with the 
shared libraries across the entire app base. Besides, I am having to jump 
through lots of hoops to get this stuff to work, which is very boxy! Anybody 
use a library jar to do the job?

Just my thoughts on image service
Brandon

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.