Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
SQL lite: text and image question
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post will appear after it is approved by moderators
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Patrick Kedziora  
View profile  
 More options Mar 23 2009, 4:37 pm
From: Patrick Kedziora <patrick.kedzi...@gmail.com>
Date: Mon, 23 Mar 2009 16:37:07 -0400
Local: Mon, Mar 23 2009 4:37 pm
Subject: SQL lite: text and image question

Hi,

I want to display questions and solutions that have text and images and want
to store them in a SQL lite database. What is the best way to do this?

Thanks,
Patrick

--
_________________________
Patrick G. Kedziora

Senior Managing Director
Growth Advisors Inc.

USA Cell: 305.788.1696
INTL Cell: (33) 6-10-69-40-63
SKYPE: pkedziora

e1: patrick.kedzi...@gmail.com
e2: patr...@growthadvisorsinc.com
i:  http://www.growthadvisorsinc.com

"UNCERTAINTY requires a GROWTH plan"


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gregory Seidman  
View profile  
 More options Mar 23 2009, 8:26 pm
From: Gregory Seidman <gsslist+iphone...@anthropohedron.net>
Date: Mon, 23 Mar 2009 20:26:50 -0400
Local: Mon, Mar 23 2009 8:26 pm
Subject: Re: SQL lite: text and image question

On Mon, Mar 23, 2009 at 04:37:07PM -0400, Patrick Kedziora wrote:
> I want to display questions and solutions that have text and images and want
> to store them in a SQL lite database. What is the best way to do this?

You almost certainly do not want to store images in the database when you
have access to a filesystem. If you have all the text and images a priori
(i.e. they are to be shipped in the app bundle), just store the names of
the images and use [UIImage imageNamed:]. If you are retrieving them from
the web or getting them from the user, I recommend using
UIImagePNGRepresentation() and storing it with a GUID for the filename
under the ~/Documents directory, then saving that name in the database. You
can retrieve it with [UIImage imageWithContentsOfFile:].

Of course, there is no problem with storing text in SQLite.

> Thanks,
> Patrick

--Greg

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brad Larson  
View profile  
 More options Mar 25 2009, 9:44 am
From: Brad Larson <lar...@sunsetlakesoftware.com>
Date: Wed, 25 Mar 2009 06:44:34 -0700 (PDT)
Local: Wed, Mar 25 2009 9:44 am
Subject: Re: SQL lite: text and image question
On Mar 23, 7:26 pm, Gregory Seidman <gsslist

+iphone...@anthropohedron.net> wrote:
> On Mon, Mar 23, 2009 at 04:37:07PM -0400, Patrick Kedziora wrote:
> > I want to display questions and solutions that have text and images and want
> > to store them in a SQL lite database. What is the best way to do this?

> You almost certainly do not want to store images in the database when you
> have access to a filesystem. If you have all the text and images a priori
> (i.e. they are to be shipped in the app bundle), just store the names of
> the images and use [UIImage imageNamed:]. If you are retrieving them from
> the web or getting them from the user, I recommend using
> UIImagePNGRepresentation() and storing it with a GUID for the filename
> under the ~/Documents directory, then saving that name in the database. You
> can retrieve it with [UIImage imageWithContentsOfFile:].

There are certain situations where it might be advantageous to store
images within the SQLite database, so that you only have to manage a
single file, rather than multiple ones across a filesystem.  I provide
an example of saving a PNG representation of an image in SQLite as a
binary BLOB on Stack Overflow:

http://stackoverflow.com/questions/643682/reading-and-writing-images-...

Personally, I use this to store small (~2kb) image thumbnails
alongside equations that I provide in a preloaded data SQLite database
within my application.  It makes it easy to copy across the entire
database from the Mac, where I create it, to the iPhone application,
where it's used.

______________________
Brad Larson, Ph.D.
Sunset Lake Software
http://www.sunsetlakesoftware.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »