[android-developers] Re: Is there any way to display 8000 * 8000 jpeg file without OutOfMemoryException
Try to use SQLite to store tiles (So there is only one db file in your sdcard.) And the speed of access files is more efficient. On 11月26日, 上午9時15分, James Wang jameswangc...@gmail.com wrote: @PJ Thanks for your interesting. We just want to display such picture, no further edition on it. In fact, we know sharp brought us with a phone-fax product-in-phone (http://www.sharp.co.jp/in-phone/index.html) with 8000*8000 photo displaying supports. Although, in-phone is not an Android Box, but it is an embedded device and they can do such thing. We just got curious about its implement. @Robert, ko5tik, Streets Of Boston Pre-processor is a good suggestion. But the side effect of it is too many chunk files on SD Card or in flash. Maybe sharp has a smarter way to achieve it and we just do not know. @Mitch Thanks for your message. I am reading it. Thanks everyone. I did not suppose so many people got interesting in this topic. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Is there any way to display 8000 * 8000 jpeg file without OutOfMemoryException
@PJ Thanks for your interesting. We just want to display such picture, no further edition on it. In fact, we know sharp brought us with a phone-fax product-in-phone (http://www.sharp.co.jp/in-phone/index.html) with 8000*8000 photo displaying supports. Although, in-phone is not an Android Box, but it is an embedded device and they can do such thing. We just got curious about its implement. @Robert, ko5tik, Streets Of Boston Pre-processor is a good suggestion. But the side effect of it is too many chunk files on SD Card or in flash. Maybe sharp has a smarter way to achieve it and we just do not know. @Mitch Thanks for your message. I am reading it. Thanks everyone. I did not suppose so many people got interesting in this topic. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Is there any way to display 8000 * 8000 jpeg file without OutOfMemoryException
My suggestion of a RandomAccessFile would involve only *one* file. This file is the RandomAccessFile, much like an uncompressed zip file, containing records, each record being a sub-jpeg. On Nov 25, 8:15 pm, James Wang jameswangc...@gmail.com wrote: @PJ Thanks for your interesting. We just want to display such picture, no further edition on it. In fact, we know sharp brought us with a phone-fax product-in-phone (http://www.sharp.co.jp/in-phone/index.html) with 8000*8000 photo displaying supports. Although, in-phone is not an Android Box, but it is an embedded device and they can do such thing. We just got curious about its implement. @Robert, ko5tik, Streets Of Boston Pre-processor is a good suggestion. But the side effect of it is too many chunk files on SD Card or in flash. Maybe sharp has a smarter way to achieve it and we just do not know. @Mitch Thanks for your message. I am reading it. Thanks everyone. I did not suppose so many people got interesting in this topic. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Is there any way to display 8000 * 8000 jpeg file without OutOfMemoryException
On the server side, Google uses MapReduce, http://code.google.com/edu/parallel/mapreduce-tutorial.html, to produce the tiles. On Nov 19, 5:06 pm, James Wang jameswangc...@gmail.com wrote: Step #2: Generate 10,000 tiles that are 80*80 instead (100 * 100 tiles). Step #3: Render tiles on-screen by drawing them on the Canvas, and support swipe gestures to move through the image by replacing tiles, much like Google Maps works. Hi Mark, AFAIK, the decoder of jpeg on android must support to read random part of jpeg file if I want do step#2 as you said. I checked out SDK reference and found out the default decoder of jpeg seems not support it. Am I right? Do I have to make another jpeg decoder? BTW, I think google map does the same thing on server side, not on mobile phone, does not it? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Is there any way to display 8000 * 8000 jpeg file without OutOfMemoryException
Extracting just a single tile out of JPEG file is a really big PITA There are about 27 different variants of JPEG (though not all really matter and are widely used) Usually you've got 8x8 tiles in row-order, and because of entropy encoding you can not navigate just to random tile - you'll have to scan from the start ( maybe you can build index, where single block-rows start - this will make scanning easier ) In this case, there will be only 1000 rows, with 1000 block in them - performance may be adequate. On Nov 20, 11:32 pm, Robert Green rbgrn@gmail.com wrote: I'd solve this by writing a preprocessor that breaks that big file down into manageable chunks. Think of having 10x10 array of 800x800 images. I would also mipmap a 4000x4000, 2000x2000, 1000x1000 and 500x500 of the file. Then, start the user on the correct zoom level, using only the tiles you need of your arrays. OpenGL is actually really good for this sort of thing. You could feasibly use 1024x1024 pixel texture tiles with an orthographic projection and let it handle the scaling. In short, I don't believe there is any way to get 8000x8000x16bit = 128MB of bitmap data into 16MB of RAM all at once, but you can definitely break it apart and work with pieces. A 1000x1000 pixel piece consumes 2MB of RAM. You could have 4 of those loaded at once and be OK on memory. If you're viewing actual pixels, you only need a max of 4 loaded at a time to have seamless panning between them. On Nov 20, 2:38 pm, PJ pjbar...@gmail.com wrote: We might be able to come up with more creative solutions if you give us more information about where the 8000x8000 jpeg file is coming from, and whether you just want to display it in a WxH view or to do something else with it. Also, since you expressed interest in Google's server-side solution for Google Maps, are you considering developing a server-side component to your app as well? If so, you could host this capability (convert 8000x8000 image to smaller image) on a server somewhere. If you try to do all processing on the device itself, it's probably going to be very slow. What does your app do? Now you've got me all curious. :D -- PJ On Nov 19, 7:06 pm, James Wang jameswangc...@gmail.com wrote: Step #2: Generate 10,000 tiles that are 80*80 instead (100 * 100 tiles). Step #3: Render tiles on-screen by drawing them on the Canvas, and support swipe gestures to move through the image by replacing tiles, much like Google Maps works. Hi Mark, AFAIK, the decoder of jpeg on android must support to read random part of jpeg file if I want do step#2 as you said. I checked out SDK reference and found out the default decoder of jpeg seems not support it. Am I right? Do I have to make another jpeg decoder? BTW, I think google map does the same thing on server side, not on mobile phone, does not it? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Is there any way to display 8000 * 8000 jpeg file without OutOfMemoryException
Like some others suggested pre-process the large file, break it up in smaller chunks, each chunk being a proper JPEG Then put all the chunks in a RandomAccessFile or a database. Be sure to be able to find the chunks by a row and column index. Then put this RandomAccessFile or database on your phone and write code to fetch each sub-jpg based on a row and colum index. On Nov 20, 3:38 pm, PJ pjbar...@gmail.com wrote: We might be able to come up with more creative solutions if you give us more information about where the 8000x8000 jpeg file is coming from, and whether you just want to display it in a WxH view or to do something else with it. Also, since you expressed interest in Google's server-side solution for Google Maps, are you considering developing a server-side component to your app as well? If so, you could host this capability (convert 8000x8000 image to smaller image) on a server somewhere. If you try to do all processing on the device itself, it's probably going to be very slow. What does your app do? Now you've got me all curious. :D -- PJ On Nov 19, 7:06 pm, James Wang jameswangc...@gmail.com wrote: Step #2: Generate 10,000 tiles that are 80*80 instead (100 * 100 tiles). Step #3: Render tiles on-screen by drawing them on the Canvas, and support swipe gestures to move through the image by replacing tiles, much like Google Maps works. Hi Mark, AFAIK, the decoder of jpeg on android must support to read random part of jpeg file if I want do step#2 as you said. I checked out SDK reference and found out the default decoder of jpeg seems not support it. Am I right? Do I have to make another jpeg decoder? BTW, I think google map does the same thing on server side, not on mobile phone, does not it?- Hide quoted text - - Show quoted text - -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Is there any way to display 8000 * 8000 jpeg file without OutOfMemoryException
We might be able to come up with more creative solutions if you give us more information about where the 8000x8000 jpeg file is coming from, and whether you just want to display it in a WxH view or to do something else with it. Also, since you expressed interest in Google's server-side solution for Google Maps, are you considering developing a server-side component to your app as well? If so, you could host this capability (convert 8000x8000 image to smaller image) on a server somewhere. If you try to do all processing on the device itself, it's probably going to be very slow. What does your app do? Now you've got me all curious. :D -- PJ On Nov 19, 7:06 pm, James Wang jameswangc...@gmail.com wrote: Step #2: Generate 10,000 tiles that are 80*80 instead (100 * 100 tiles). Step #3: Render tiles on-screen by drawing them on the Canvas, and support swipe gestures to move through the image by replacing tiles, much like Google Maps works. Hi Mark, AFAIK, the decoder of jpeg on android must support to read random part of jpeg file if I want do step#2 as you said. I checked out SDK reference and found out the default decoder of jpeg seems not support it. Am I right? Do I have to make another jpeg decoder? BTW, I think google map does the same thing on server side, not on mobile phone, does not it? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Is there any way to display 8000 * 8000 jpeg file without OutOfMemoryException
I'd solve this by writing a preprocessor that breaks that big file down into manageable chunks. Think of having 10x10 array of 800x800 images. I would also mipmap a 4000x4000, 2000x2000, 1000x1000 and 500x500 of the file. Then, start the user on the correct zoom level, using only the tiles you need of your arrays. OpenGL is actually really good for this sort of thing. You could feasibly use 1024x1024 pixel texture tiles with an orthographic projection and let it handle the scaling. In short, I don't believe there is any way to get 8000x8000x16bit = 128MB of bitmap data into 16MB of RAM all at once, but you can definitely break it apart and work with pieces. A 1000x1000 pixel piece consumes 2MB of RAM. You could have 4 of those loaded at once and be OK on memory. If you're viewing actual pixels, you only need a max of 4 loaded at a time to have seamless panning between them. On Nov 20, 2:38 pm, PJ pjbar...@gmail.com wrote: We might be able to come up with more creative solutions if you give us more information about where the 8000x8000 jpeg file is coming from, and whether you just want to display it in a WxH view or to do something else with it. Also, since you expressed interest in Google's server-side solution for Google Maps, are you considering developing a server-side component to your app as well? If so, you could host this capability (convert 8000x8000 image to smaller image) on a server somewhere. If you try to do all processing on the device itself, it's probably going to be very slow. What does your app do? Now you've got me all curious. :D -- PJ On Nov 19, 7:06 pm, James Wang jameswangc...@gmail.com wrote: Step #2: Generate 10,000 tiles that are 80*80 instead (100 * 100 tiles). Step #3: Render tiles on-screen by drawing them on the Canvas, and support swipe gestures to move through the image by replacing tiles, much like Google Maps works. Hi Mark, AFAIK, the decoder of jpeg on android must support to read random part of jpeg file if I want do step#2 as you said. I checked out SDK reference and found out the default decoder of jpeg seems not support it. Am I right? Do I have to make another jpeg decoder? BTW, I think google map does the same thing on server side, not on mobile phone, does not it? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Is there any way to display 8000 * 8000 jpeg file without OutOfMemoryException
Step #2: Generate 10,000 tiles that are 80*80 instead (100 * 100 tiles). Step #3: Render tiles on-screen by drawing them on the Canvas, and support swipe gestures to move through the image by replacing tiles, much like Google Maps works. Hi Mark, AFAIK, the decoder of jpeg on android must support to read random part of jpeg file if I want do step#2 as you said. I checked out SDK reference and found out the default decoder of jpeg seems not support it. Am I right? Do I have to make another jpeg decoder? BTW, I think google map does the same thing on server side, not on mobile phone, does not it? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Is there any way to display 8000 * 8000 jpeg file without OutOfMemoryException
Thanks Mark! I will take a try. On Oct 22, 8:23 pm, Mark Murphy mmur...@commonsware.com wrote: James Wang wrote: Hi, We are going to develop an app supporting 8000 * 8000 jpeg file (over hundreds of Megabytes). Is there any way to achieve it in ADP1? Step #1: Don't do that. Step #2: Generate 10,000 tiles that are 80*80 instead (100 * 100 tiles). Step #3: Render tiles on-screen by drawing them on the Canvas, and support swipe gestures to move through the image by replacing tiles, much like Google Maps works. You would need to do this on pretty much any platform (mobile, Web, even desktops if you don't want to mandate 64-bit and 16GB of RAM). Bear in mind that a JPEG of over hundreds of Megabytes, when uncompressed for display, will require many GB of RAM. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Android Training in Germany, 18-22 January 2010:http://bignerdranch.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Is there any way to display 8000 * 8000 jpeg file without OutOfMemoryException
James Wang wrote: Hi, We are going to develop an app supporting 8000 * 8000 jpeg file (over hundreds of Megabytes). Is there any way to achieve it in ADP1? Step #1: Don't do that. Step #2: Generate 10,000 tiles that are 80*80 instead (100 * 100 tiles). Step #3: Render tiles on-screen by drawing them on the Canvas, and support swipe gestures to move through the image by replacing tiles, much like Google Maps works. You would need to do this on pretty much any platform (mobile, Web, even desktops if you don't want to mandate 64-bit and 16GB of RAM). Bear in mind that a JPEG of over hundreds of Megabytes, when uncompressed for display, will require many GB of RAM. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Training in Germany, 18-22 January 2010: http://bignerdranch.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---