Opening a camera raw file
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 845
- Joined: Wed Nov 04, 2009 11:41 am
- Location: Gunthorpe, North Lincs, UK
Opening a camera raw file
Hi,
Is there any way of displaying a raw image in a livecode stack?
best wishes
Simon K.
Is there any way of displaying a raw image in a livecode stack?
best wishes
Simon K.
best wishes
Skids
Skids
-
- Livecode Opensource Backer
- Posts: 9287
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Opening a camera raw file
Well, here's what the documentation says:
"The import command can import GIF, JPEG, PNG, BMP, XWD, XBM, XPM, or PBM, PGM, or PPM files."
Mind you, I cannot help feeling that a lot of those image formats are either extremely obscure or outdated.
Um: XWD (X Window Dump) format.
An XBM file is an X Bitmap Graphic file.
X PixMap (XPM) X Window System format.
These look like hangovers from MetaCard's UNIX days.
The PBM format is a lowest common denominator monochrome file format.
The PGM format is a lowest common denominator grayscale file format.
The PPM format is a lowest common denominator color image file format.
"The import command can import GIF, JPEG, PNG, BMP, XWD, XBM, XPM, or PBM, PGM, or PPM files."
Mind you, I cannot help feeling that a lot of those image formats are either extremely obscure or outdated.
Um: XWD (X Window Dump) format.
An XBM file is an X Bitmap Graphic file.
X PixMap (XPM) X Window System format.
These look like hangovers from MetaCard's UNIX days.
The PBM format is a lowest common denominator monochrome file format.
The PGM format is a lowest common denominator grayscale file format.
The PPM format is a lowest common denominator color image file format.
-
- Posts: 845
- Joined: Wed Nov 04, 2009 11:41 am
- Location: Gunthorpe, North Lincs, UK
Re: Opening a camera raw file
Phew, that was a long way to say no . Thanks for confirming what I suspected and giving me a lesson in old image file formats.
best wishes
Simon K.
best wishes
Simon K.
best wishes
Skids
Skids
-
- Livecode Opensource Backer
- Posts: 9287
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Opening a camera raw file
I didn't intend that, it is just when I saw all those strange suffixes I thought I'd findthat was a long way to say no
out what on earth they all stood for.
Re: Opening a camera raw file
XWD, XBM, XPM, PBM, PGM and PPM are "leftovers" from the early UNIX only days (early 90s) of Metacard!
Maybe they keep them for nostalgic reasons...
Maybe they keep them for nostalgic reasons...
-
- Livecode Opensource Backer
- Posts: 9287
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Opening a camera raw file
I wonder if anyone at LiveCode central has heard of appendectomies?
Re: Opening a camera raw file
Why? You can use any (or all) of those formats on 'nixen boxen still, you insensitive clots
-
- Livecode Opensource Backer
- Posts: 9287
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Opening a camera raw file
Ha, Ha, Ha . . .you insensitive clots
Why, pray tell would you want any of those image formats on Linux when desktop Linux is now
quite capable of handling JPG, PNG, BMP and GIF?
- -
Would you like Klaus and myself to fly over and cover you with kisses so you feel better?
Re: Opening a camera raw file
Variety, it is the spice of life!richmond62 wrote: ↑Sat Dec 14, 2019 11:26 pmWhy, pray tell would you want any of those image formats on Linux when desktop Linux is now
-
- Posts: 845
- Joined: Wed Nov 04, 2009 11:41 am
- Location: Gunthorpe, North Lincs, UK
Re: Opening a camera raw file
Dragging the thread back to the topic........
I would really like to be able to display a thumbnail of raw image. I have written a small app to rename and move image files from an memory card. At the moment I open an answer files dialog and select the images. This is o.k. but my renaming utility allows the name to include a reference to the event. It is likely that all the images taken at an event have the same creation date and I would like to be able to have the option of selecting all the images taken on a given date and assign them an event name all from within the application. To do this it is necessary to be able to view at least one image from the group in order to remember where I was on a given date.
I believe that most if not all camera raw files include a jpeg thumbnail and a jpeg preview. I also think that camera raw files are based on the tiff file format. So at the moment it seems that I have to read up on reading bytes from tiff files and following offsets to image file directories (see https://www.awaresystems.be/imaging/tif ... /TIFF6.pdf) and then onto the images themselves.
Its all doable but is tending towards hard work, meaning that I will probably just live with looking at the previews in the answer files dialog. So I wonder if there are any libraries out there that can lighten the load.
best wishes
Simon k.
I would really like to be able to display a thumbnail of raw image. I have written a small app to rename and move image files from an memory card. At the moment I open an answer files dialog and select the images. This is o.k. but my renaming utility allows the name to include a reference to the event. It is likely that all the images taken at an event have the same creation date and I would like to be able to have the option of selecting all the images taken on a given date and assign them an event name all from within the application. To do this it is necessary to be able to view at least one image from the group in order to remember where I was on a given date.
I believe that most if not all camera raw files include a jpeg thumbnail and a jpeg preview. I also think that camera raw files are based on the tiff file format. So at the moment it seems that I have to read up on reading bytes from tiff files and following offsets to image file directories (see https://www.awaresystems.be/imaging/tif ... /TIFF6.pdf) and then onto the images themselves.
Its all doable but is tending towards hard work, meaning that I will probably just live with looking at the previews in the answer files dialog. So I wonder if there are any libraries out there that can lighten the load.
best wishes
Simon k.
best wishes
Skids
Skids
-
- Livecode Opensource Backer
- Posts: 9287
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Opening a camera raw file
http://lists.runrev.com/pipermail/use-l ... 55010.html
You can use a revBrowser object to look at tiffs.
You can use a revBrowser object to look at tiffs.
Re: Opening a camera raw file
If your image have a jpg thumbnail, this could work:
Check the mail list thread here:
http://lists.runrev.com/pipermail/use-l ... 10507.html
By the way, it would be very useful a function to check
if the binary data is a valid jpeg image.
Code: Select all
on mouseUp
local temp
answer file "Select image with EXIF thumbnail data"
put it into temp
open file temp for binary read
read from file temp for 500000
put it into temp1
close file temp
put numtobyte(255) & numtobyte(216) into tStart
-- in Hexadecimal: FFD8 = SOI(Start of jpeg image)
put numtobyte(255) & numtobyte(217) into tEnd
-- in Hexadecimal: FFD9 = EOI(End of jpeg image)
delete byte 1 to 2 of temp1
-- delete JPEG SOI (Start of jpeg image)
if byte -2 to -1 of temp1 = tEnd then delete byte -2 to -1 of temp1
-- delete JPEG EOI(End of jpeg image)
set the casesensitive to true
repeat 2
-- Most Raw Image files just have 2 jpeg thumbnails
put offset(tStart,temp1) into tThumbstart
put offset(tEnd,temp1) into tThumbEnd
put byte tThumbstart to (tThumbEnd + 1) of temp1 into tJPGThumb
delete byte 1 to (tThumbEnd + 1) of temp1
if tJPGThumb is not empty
then
create img
set the text of it to tJPGThumb
else
answer "No JPEG Thumbnails in this image"
exit to top
end if
end repeat
end mouseUp
http://lists.runrev.com/pipermail/use-l ... 10507.html
By the way, it would be very useful a function to check
if the binary data is a valid jpeg image.
Last edited by capellan on Tue Dec 24, 2019 3:01 am, edited 3 times in total.
Re: Opening a camera raw file
Hi Simon,
Which Brand is your camera?
In this website, the author make available to download
samples of Raw files from different cameras.
https://rawsamples.ch/index.php/en/
The script posted previously (now corrected)
works with these raw images formats:
Nikon NEF and NRW raw formats:
http://www.rawsamples.ch/raws/nikon/d1x ... ON_D1X.NEF
Sony ARW and SR2 raw formats:
http://www.rawsamples.ch/raws/sony/a100 ... Y_A100.ARW
Olympus ORF raw format:
http://www.rawsamples.ch/raws/olympus/R ... _E-PM1.ORF
Pentax PEF and DNG raw formats:
http://www.rawsamples.ch/raws/pentax/RAW_PENTAX_K-m.PEF
Which Brand is your camera?
In this website, the author make available to download
samples of Raw files from different cameras.
https://rawsamples.ch/index.php/en/
The script posted previously (now corrected)
works with these raw images formats:
Nikon NEF and NRW raw formats:
http://www.rawsamples.ch/raws/nikon/d1x ... ON_D1X.NEF
Sony ARW and SR2 raw formats:
http://www.rawsamples.ch/raws/sony/a100 ... Y_A100.ARW
Olympus ORF raw format:
http://www.rawsamples.ch/raws/olympus/R ... _E-PM1.ORF
Pentax PEF and DNG raw formats:
http://www.rawsamples.ch/raws/pentax/RAW_PENTAX_K-m.PEF
-
- Posts: 845
- Joined: Wed Nov 04, 2009 11:41 am
- Location: Gunthorpe, North Lincs, UK
Re: Opening a camera raw file
Sorry I missed your last post back in December. I will have a look at your code.
Typically I'm using a Panasonic camera.
Typically I'm using a Panasonic camera.
best wishes
Skids
Skids