Best way resize photo gallery for preview - objective-c

My app has more then 1000 photos and 50 galleries. It looks like as iphone Photos app. In preview list of gallery I have problem with performance.
In profile I saw what [sourceImage drawInRect:thumbnailRect] take 96% of time.
What is the best way to fix this issue?
Duplicate with small size of images I did.
Perhaps there is another solution?

Best way is to create thumbnail images for every Image File and save them as thumb_orginalimagefilename.png.

You can batch edit images in many desktop publishing programs.
Photoshop or Fireworks. In Picasa you can just multi-select a ton of images, like an entire folder and then Export to File and choose the output size

Create three large images that contain all of the thumbs in each gallery and load them in one UIScrollView with semi-transparent UIImageButtons over the locations where the thumbs appear in the image.
This could prove faster, since you only load one image per gallery, but you would have to try it to find out. I have done this before as it helped to reduce the size of my app.

Related

Load of multiple image files from a remote repository ios7

In my project i have about 100 images all tiled to display large zooms with CATiled methods. These are a lot of files that, if put in a local bundle, rapidly make the app bundle too big.
I want to load these files from a web repository, using SDWebImage or any other sdk.
Can you suggest any method to achieve this? Please keep in mid we are not talking of loading a single image, or multiple images for a UITableView, but lots of little tiled images that will be used when the user make zoom in a given view, and therefore this tiles have no UIImageview object to hold them, they are just in the bundle (now).
We are using ios7.
Thank you in advance.

Do repeated images increase the loading time of a website?

I'm trying to optimize the loading time of my website.
Does requesting the same image in different places of the code increase load time?
For example, I'm using an image as background of a button and I'm loading the same image in different places of the website.
Is this a problem or since the file is the same in all the buttons the browser only loads it once?
If it's a problem, how can I optimize it? Thanks a lot!
no, repeating the same image multiple times should load it only once. You could even go further and actually use css sprites to have multiple images in one (one image which is a grid of images as a background within a smaller containing div and move it around with background position property)

Making Images Viewed By UIWebView Smaller

i have a list of entries from a database and I'm feeding them in to HTML to a UIWebView that is making a list of the database entries on the page.
(Much Easyer/Better then extending UITableView Cells)
My Problem is with UITableView i was able to grab an image on a server as NSData and with UIImageJpegRepresentation set the quality for the image a bit lower to be better on the iPhone's cellular downloads.
Now i can go and grab an image from the server as NSData Compress the image then convert it to base 64string and spit it into the WebView but is there any other way to do this?
TLDR: How can i decrease the size of images seen in a HTML Page?
I fixed this by feeding the page i was going to visit to a web service. The web service then returns a set of images compressed at lower quality.
Because the only pages the app is going to visit were my own with user avatars and stuff i was able to profile what images would be needed.
On the iPhone i rebuilt the webpage with the set of those smaller images in a UIWebView.
So in the end i downloaded less cellular data and problem is solved.

animation in game application in android

I am working on image animation. I have 200 transparent png images which I am trying to show one by one over a background image.
Can you tell me the best way to do it. The image should change in such a way that it should appear that a cartoon is running.
thanx
pavan
Did you end up finding a solution for this? I would be interested in knowing. If you do not need to animate quicker than every 300ms then this may work for you see my post:
See: 750 frame transparent PNG animation in ImageView at 23fps
Also using Animation.drawable could be an option if you can split your cartoon it up into small pieces 40-50 frames at a time and then play them one after the other.
I'm still looking for a better solution for this so would be interested to see another way.

iOS: storing thumbnail images in Core Data

I need to take some images from the iPhone / iPad photo library from within my app and store them in a Core Data entity, and display them as small thumbnail images (48x48 pixels) in a UITableViewCell, and about 80x80 pixels in a detail UIView. I've followed the Recipes sample app, where they use UIImageJPEGRepresentation(value, 0.1) to convert to NSData and store the bytes inside Core Data, and it doesn't end up taking much space, which is good. But when retrieve the data, using UIImage *uiImage = [[UIImage alloc] initWithData:value]; and display it as a thumbnail image with "Aspect Fit", it looks terrible and grainy. I tried changing the image quality variable in the JPEG compression, but even setting it to 0.9 doesn't help.
Is that normal? Is there a better way to compress the image that doesn't cause so much grainee-ness? Since I just want to show a small thumbnail, and then a slightly bigger thumbnail, I feel Core Data would be great for storing this, since it should (theoretically) also support iCloud. But if it's going to look terrible, then I'll have to reconsider.
Two things, are you resizing the image to the right size? Have you tried UIImagePNGRepresentation()? That should compress it without losing quality.
If UIImagePNGRepresentation (which is lossless) is giving you bad images, then the problem is in your image resizing code. Core Data is just giving you what you back what you put in, so if you get bad images out, it's because you put bad images in.
Is one of your iPhone/iPad retina and the other isn't? If so, perhaps the problem is that you don't really want 48x48 pixel images, you want 48x48 point (which means you'll need 2x images 96x96 for retina quality display).