I am working on MCB 2300 kit which has got LPC2378 processor. It has got an SD card as well. I can read, write to some text files on the card. But now I want to read some images from SD Card. When i tried to read the images, it gives back some garbage value and then the program gets hang up. I want to read the pixel information of the image. Please let me know how to do it? I am using keil uVision4 IDE
You need to treat the file as binary (not text) data, i.e. no end-of-line conversions or other special character handling.
But you also need to write code for the specific image file format. If you are going to read data from a GIF file, then you need to implement code that understands the GIF file format. Same for JPEG, PNG, BMP, TIFF or any other standard image format.
When you are able to extract binary data from the SD card, the rest of the processing will be the same as if a PC program decoded the image file.
Thanks for the information. Are there any sample codes available using which we can read atleast one kind of image formats (gif or tiff or jpg or png)
Much code available if you google.
libjpeg - reads JPEG files. libpng - reads PNG files. libtiff - reads TIFF files. giflib - reads GIF files.
Do you see any pattern? Shouldn't be too hard to locate libraries for other image formats too.
Yes - but what happened with GIF ?!
I think giflib is the oldest. It really was many years since gif was at the top of the food chain. They probably hadn't figured out then that it's an advantage to have 'lib' first if you build for Unix machines, where you link against libxx.a. Looks so bad to have giflib.c and build libgif.a or maybe libgiflib.a.
Hi I am trying to read SD/ micro SD card on LPC2478 , but with the sample code availaible with the name MCI over LPC2300, I am not able to read or write any data on the card, but the code is able to give commands as the code successfully does the configuring part.
I have done modification to the code to make it 24XX, more oever there is a register call MCI_MASK1 , there is no description of the register in the user manual
What does your problem with porting a LPC23xx application to LPC24xx have to do with a thread asking for how to read images (pictures) from an SD-card?
Create your own thread for your own problems.
You can always give links to reference threads that you think may be relevant - but don't hijack those threads!
sorry guys , this was not supposed to be posted here, i guess something happned.......
apologies