Windows Phone - Store image in database or IsoStore - image

I capture images within my app and need to store them. I'm not sure where the right place is to store the captured image. Storing the image as byte array in the database would be very nice but whats happening if the next-gen smartphones getting a high-resoltion camera and the images become bigger? Are they exceeding my database limit or my app becomes slowly?
Is it better to store the image into IsoStore?

I'd store in the isostore, if you want to use database, you might just store the path of the image or name to be able to find it from the isostore.
It should be faster to use isostore instead of database.

If you want to store image in database use blob type attribute in database,
Convert the image in byte-array and execute the database command.
To convert the object in byte array follow the link.
This answer is based on sqlite database.

Related

Create static content with images and videos and show it in my spring-boot application

I wrote some basic blog system, which based on spring boot.
I'm trying to figure out, how can I create posts with videos and images, without the need to editing everything using HTML.
Right now, I am saving my blog posts in DB as plain text.
Is it possible to create content combined with text, images and videos , and saving this "content" as one row in my DB-Table, without creating connections between different tables?
Many thanks in advance.
Images and Videos are heavy content and storing them in database could be a costly affair, until you are developing application for research purpose. Also querying it from database and serving it over the network can impact your application performance.
If you want to store it in a single row that can be done as well using database BLOB object. But i would suggest to have 2 different tables. One containing the BLOB object of Image and Videos and other is your usual table containing blog as text and primary key of of BLOB table.
If you want to take your solution to go live, better use image-videos hosting servers because of following factors
Saves your database cost
Ensures 24x7 availability
Application performance is faster as these are hosted independent of application
Videos can directly be iframed i.e. you do not need to query complete MBs of record and serve over network
A strict answer to your question, yes, you can use BLOBs to store the video/images in the database. Think about them as a column that contains bytes of video or image.
For school/cases where you have a very small amount of videos/images its probably OK. However if you're building a real application, then don't do it :)
Every DBA will raise a bunch of concerns "why do not use Blobs".
So more realistic approach would be to find some "file-system" like storage (but distributed) style S3 in AWS, hardrive on server if you're not on cloud, etc.
Then store that big image / video there and get an identifier (like path to it if we're talking about the harddrive) and store that identifier in the database along with the metadata that you're already store probably (like blogPostId, type of file, etc.)
Once the application become more "mature" - you can switch the "provider" - Grow as you go. There are even cloud storages designed especially for images (like Cloudinary).

Insert base 64 encoded image into oracle database

I am working on hybrid mobile application in which I have a scenario to store images in to oracle database through web-API. I can get the images as base-64 encoded from API. So how can i save them to database and what datatype should I use to store them
If you want to insert image you can use BLOB data type . about how storing pictures in database check storing pic and photos and how to store image

mac os x how to add files to core data database

I want to storage images and the core data database of my app but I can not figure out how to add the images to my core data data base. By any chance any of you knows how can I do this?. I'll really appreciate your help.
This can by done by using a Binary Data attribute on your entity. This allows you to store binary data (such as images or files) directly in a core data database. If the files/images are expected to be over 10MB, I would check the "Allows External Storage" checkbox in the attribute inspector for your binary data attribute. This allows core data to store this data in a file external to your .sqlite file. This helps with fetching/saving efficiency, but if you have a heavy load of images/files, you're better off managing the files yourself. Core Data isn't optimized for large blobs of data.
You have to add images as binary data, NSData.
But this is not efficient to handle. Better way to save the images as file and then store the file name in the database. This will save the query overhead.
You might want to consider using a Transformable attribute which will handle the transformation to and from NSImage automatically. Bear in mind if you want images to be compatible with iOS you best stick with PNG format.

How to store image as cookie?

Hello
I am working on codeigniter project.
And my question is that : Is it possible to store image as cookie ??
If yes then can please you provide me some documentation or examples on it?
A cookie is a short piece ox text that is stored on the user's computer. Typically it will be no more than 4096 bytes (the lower limit specified by RFC2109). If you can compress and base64 encode an image into this then it might be possible to store an image, but it will be a small image indeed!
There are many ways to tackle the situation,
1.Encode the image to string and store the string to a cookie, but the size limit is 4kb
2.Store the image link to a cookie, but it should either located in our server or the image must be in the internet for locating.
3.Use HTML5 to store images locally HTML5 code example: Intelligently store Images in localStorage for faster page loads!
i have not tried this but i think if you use codeigniter sessions - with a session database table - then you might be able to store the image in the session db table. when you use a session table, codeigniter only stores an ID in the users cookie.
http://ellislab.com/codeigniter/user-guide/libraries/sessions.html

Performance in tables with binary data/images

I made a people maintenance screen. The client want me to store the photo of every person in the database, and I made it without problems. I have a separate table for the images with two fields, Id_person,and Image.
I'm a little worried because it's the first time that i work with images in database. will I have problems of performance when the table grows beyond 1000/5000 images? I suppose that the size of every image will make a difference. I'm sure that I will need to control that the user don't save very big images in the Database.
What would be a good size limit? The client only need pics of the face, but I'm sure that someone will try to make the pics with a "last model" camera in full quality ;)
Thanks.
It's usually preferred to keep a folder of images and the DB just references that folder. Ideally, each person has a unique ID and the files in the "images" folder match that ID.
If you really want to store the binary data directly, you can get a reasonable quality photo in 8KB of a JPEG (approx 250x250 pix # 25% quality). Of course, this would be unacceptable for printing, but is fine for identification.
Only you will know if you can accept an additional 8KB per row in your database server.
If you absoultely MUST do it this way, I would say limit it to just a few kilobytes each. However, every database admin in the world will probably tell you that blobing images into a database field is a very, very bad idea. Most noticably you will see the performance decrease drastically when the database file grows beyond two gigabytes in size.
I would prefer to do as jheddings said and have a folder with each person's ID be the file name and just use a standard .jpg or something after that on a network share so all computers using the app can access the images.
Some find that simply using the ID isn't good enough incase the photo needs to be deleted or archived, in which case they will put a NVARCHAR(MAX) field into their database and store the network file path to the image instead of the actual image.
I would only blob the image if your customer absolutely cannot have a network share path.
as long as it is in separate table with ID|BLOB only there shouldn't any performance issues fetching that photo, but on the other side i prefer keeping in DB only references to files on hdd (or even better if its only user photo you dont realy need a reference because user with ID 1 goes to /images/1.jpg)

Resources