Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
amardeepjaiman
Posts: 293
Registered: ‎02-25-2009
My Device: Not Specified

how to create thumbnails of images using NDK

Hi,

 

In my application i have need to create thumbails of the images provided. How we can create thumbails of the images using BB 10 NDK.

 

Thanks,

Amardeep

BlackBerry Development Advisor (Retired)
mgoulet
Posts: 329
Registered: ‎05-07-2012
My Device: BB Alpha

Re: how to create thumbnails of images using NDK

Hi there,

 

Are you referring to changing the size of a loaded image to make it smaller? Have you looked a the 'scaleX and scaleY" properties of the ImageView?

https://developer.blackberry.com/cascades/reference/bb__cascades__imageview.html

 

Martin

 

Developer
amardeepjaiman
Posts: 293
Registered: ‎02-25-2009
My Device: Not Specified

Re: how to create thumbnails of images using NDK

Hi,

 

Actually my need is to show each image in device to be shown in thumbail view. So i think scaling each and every image would quite a bit memory and not a good option.

 

On earlier platforms like BB 7.1 and BB 6 we used to read thumbnail informations from "thumbs.db" file stored in each folder on file system. Does BB 10 NDK has this kind of machenism ?

BlackBerry Development Advisor (Retired)
mgoulet
Posts: 329
Registered: ‎05-07-2012
My Device: BB Alpha

Re: how to create thumbnails of images using NDK

How many images you plan on having in your list? ImageView could be a good option without calling scale functions; I don't think there is such a thing as a thumbs.db currently in thte works, unfortunately;

 

Martin

Developer
blackqtcoder
Posts: 146
Registered: ‎05-18-2012
My Device: PlayBook & STL100-1 LE Z10 & Dev Alpha C

Re: how to create thumbnails of images using NDK

Exif library perhaps ?

---------------------------------------------------------------
Leandro Cerdan - Duantox Apps
BlackBerry Elite dev
TapyHold, Built for Blackberry multimedia scrapbook
BlackBerry Development Advisor
smcveigh
Posts: 668
Registered: ‎11-29-2011
My Device: developer

Re: how to create thumbnails of images using NDK

Fortunately, something like thumbs.db does exist, but it is undocumented and the interface is changing anyways, so I wouldn't depend on what is presently available.

In the meantime, I suggest creating your own thumbnail cache in your app's sandbox or an appropriate location.  You can open, load, scale, and save the thumbnails using libimg.  This is how the media indexer on the device does it already.

 

Cheers,

Sean

Developer
blackqtcoder
Posts: 146
Registered: ‎05-18-2012
My Device: PlayBook & STL100-1 LE Z10 & Dev Alpha C

Re: how to create thumbnails of images using NDK

[ Edited ]

Ok, sean. I think try it with QImage's scale method at another thread and save thumbnail file in sandbox. 

At other side I don't know Libimg, but I know is a very very low level library. Perhaps, Qt's way is a bit slower than Libimg, but is much more easier than this.

 

Thanks, Sean.

Bests regards

---------------------------------------------------------------
Leandro Cerdan - Duantox Apps
BlackBerry Elite dev
TapyHold, Built for Blackberry multimedia scrapbook
Contributor
casantos
Posts: 33
Registered: ‎01-13-2013
My Device: BlackBerry Z10, Q10

Re: how to create thumbnails of images using NDK

Hi,

 

Ressurrecting an old thread, are there any news about the thumbnails database?

 

I suppose that you referring to the "thumbnails" table in /System/db/mmlibrary.db when you said that "something like thumbs.db does exist".

 

Carlos

BlackBerry Development Advisor
smcveigh
Posts: 668
Registered: ‎11-29-2011
My Device: developer

Re: how to create thumbnails of images using NDK

yes, that's what I'm referring to.

The problem with attempting to use that database is that it is undocumented and subject to change frequently.  On top of this, there are some related pps objects you need to be aware of, and some other custom filesystem things.  You also have to handle contention between other accessors.  In a nutshell, it is not user-friendly.

 

We still do plan to ultimately wrap all of these warts up in an easy-to-use API.  It just doesn't exist yet, and I am not sure what the ETA is.

 

Until then, you're going to have to roll your own thumbnail database in your app's sandbox, or do things on-the-fly.

 

Cheers,

Sean