[google-appengine] how to reduce image size (in bytes)

2011-04-04 Thread Yonatan Maman
I have an Image, which I want to reduce its size (in bytes).
I tried to do it by resizing the image dimensions but the size (length
of byte array) of the transformed image was larger than the original
image :-)

I understand that I need somehow to compress/code the image. how can I
do that using Image api ?
please  see my question in stackoverflow
http://stackoverflow.com/questions/5532728/fail-reducing-image-size-using-goolge-app-engine-images-java-api

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



[google-appengine] Re: Don't Understand Blobstore limits

2011-04-03 Thread Yonatan Maman
I'm trying to use the new File/Blob API which was released in the
1.4.3 version.
I have no problem storing files  1MB.
for larger files I'm splitting the writting into smaller chunks of
800KB

private void putInBlobstore(String mt, byte[] data) throws Throwable {
 final FileService fileService =
FileServiceFactory.getFileService();
 final AppEngineFile file = fileService.createNewBlobFile(mt);
 final FileWriteChannel writeChannel =
fileService.openWriteChannel(file, true);
 int pos = 0;
 final long dataLen = data.length;
 while (pos  dataLen) {
final int hm = (int) Math.min(dataLen - pos, 80);
final int actual = writeChannel.write(ByteBuffer.wrap(data, pos,
hm));
pos += actual;
 }
 writeChannel.closeFinally();
}

but it didn't work :-( I also tried to create different files for each
of the chunks (i.e. put file, and writeChannler creation inside the
loop),

private void putInBlobstore(String mt, byte[] data) throws Throwable {
 int pos = 0;
 final long dataLen = data.length;
 while (pos  dataLen) {
final FileService fileService =
FileServiceFactory.getFileService();
final AppEngineFile file = fileService.createNewBlobFile(mt);
final FileWriteChannel writeChannel =
fileService.openWriteChannel(file, true);
final int hm = (int) Math.min(dataLen - pos, 80);
final int actual = writeChannel.write(ByteBuffer.wrap(data, pos,
hm));
pos += actual;
 }
 writeChannel.closeFinally();
}
but it didn't work as well :-(
Can you please elaborate the term 1MB per API call which API ?
Thanks in advance -- Yonatan


On Apr 2, 7:38 pm, Movesax move...@gmail.com wrote:
 thanks very much, you've both cleared things up for me.

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