Filestream.write for .jpgs

Hi,
i am working on an AIR-Project. The User can load pictures from his computer into the Air-Project. What I want is, to save these pictures automaticly at a certain Folder. I need that because the next time the user is using the Program the picture shall be seen (so i have to have it in a certain Folder)
I just learned how to create a new document in a certain Folder:
import flash.filesystem.FileStream;
import flash.events.Event;
import flash.filesystem.File;
import flash.errors.IOError;
var fileStream:FileStream;
fileStream = new FileStream();
fileStream.addEventListener(Event.CLOSE, fileCloseHandler);
fileStream.addEventListener(IOErrorEvent.IO_ERROR, fileIOError);
var writeFile:File;
writeFile = File.documentsDirectory.resolvePath('AIR/test.txt');
fileStream.openAsync(writeFile, FileMode.WRITE);
fileStream.writeUTFBytes('Hello World');
fileStream.close();
function fileIOError(event:IOErrorEvent):void
trace ("Sorry did not work");
function fileCloseHandler(event:Event):void
trace ("DONE");
So far so good :-)
All the Examples i found creating a (.txt) text-file where the content was set by:
fileStream.writeUTFBytes("Hello World');
Now i have 2 Problems;
1) as far as I understand I need to change from "writeUTFBytes" for text-files to something like "writeObject" or "writeBytes" to stream .jpg data - right???
2) the bigger Problem - I do not know how to let my graphic.data be the content instead of the "Hello World"
What i have now does work in parts - the first part loads the picture "pic.jpg" / and the second part is a version of the code above that worked well for a .txt
What does not work is, that I do not get the content of "graphic" into the file to be streamed...
Here is what i have;
var graphic:Loader = new Loader();
var url:URLRequest = new URLRequest("pic.jpg");
graphic.load(url);
graphic.contentLoaderInfo.addEventListener(Event.COM PLETE, done);
addChild(graphic);
function done(evt:Event)
trace ("loaded");
import flash.filesystem.FileStream;
import flash.filesystem.File;
import flash.events.Event;
import flash.filesystem.File;
import flash.errors.IOError;
var savethis:File = new File();
savethis = graphic.data;
var fileStream:FileStream;
fileStream = new FileStream();
fileStream.addEventListener(Event.CLOSE, fileCloseHandler);
fileStream.addEventListener(IOErrorEvent.IO_ERROR, fileIOError);
var writeFile:File;
writeFile = File.documentsDirectory.resolvePath('AIR/pic.jpg');
fileStream.openAsync(writeFile, FileMode.WRITE);
fileStream.writeObject(savethis);
fileStream.close();
function fileIOError(event:IOErrorEvent):void
trace ("Did not work");
function fileCloseHandler(event:Event):void
trace ("good work");
Hope you can help me with this!!!
Try to keep you answer simple - i am not an every-day flasher (looks like I am getting there :-))
Jan

I'm having the exact same issue.  I purchased Aperture recently just so I could edit the metadata on lots of old jpg pictures and scans.  Until I upgraded to Lion, it was working well.  Now with Lion, I can still edit the metadata, but I cannot write the metadata back to the master.   I just spent the last two days filling out the metadata info (primarily Title and Caption), figuring to save to master once I got done with the batch of photos I'm currently working on.  I don't want to lose my work. 
I'm wondering if I can accomplish the same thing by exporting my updated metadata versions and reimporting them.  Might that work?  Will I lose/gain anything in the process? 

Similar Messages

  • No XMP files are written for JPGs even when explicitely requested

    Morning all,
    I have learned not to trust the LR database too much. Thanks to Dan Tull I had my corrupted file repaired, but with 10,000+ tagged and processed RAWs, I do not feel too safe with the database alone. So I have decided to have XMP files written for all photographs. With 1.0 it worked only for my RAW files, not for my JPGs (have no other types).
    So I was happy to find a flag "Write XMPs also for JPGs" in the catalog settings of 1.1. However, whether I check it or uncheck it, no XMP is written for JPGs. Neither when I let LR automatically write XMPs nor when I do it manually from the menu...
    Anyone having an idea how to make this setting work?
    Thanks,
    Dirk

    The advantage of sidecar files is that they are nondestructive to the original image. So exporting the images is no point.
    And that the data written to the JPG contains all the settings is simply not the case. Try it out as follows: get hold of any one JPG in the finder. Import it to Lightroom. Do some strange manipulations on it, crop and go b/w. Then choose "Save metadata to file" from the Metadata menu in Library module. Now go to finder. The JPG is updated indeed. Copy it and import the copy into LR. The new version is the same as the original, no settings applied. And how could it? JPG is a defined format and it does not have room for most of the information that can be put to XMPs. So whatever you might expect from that export will disappoint you should you ever need it ;-)
    Anyway, the issue remains: I would not expect LR to write more (e.g. virtual copies) than it does for RAWs, but I would expect it to write an XMP which is what the option offers: "Write develop settings to XMP for JPG...". How can I make it work?

  • I write both JPG and DNG files in the camera.   Camera is a Leica Monochrom.   Photo, unlike iPhoto, seems to ignore DNG files and only imports JPG files.   What am I missing here?

    I write both JPG and DNG files in the camera.   Camera is a Leica Monochrom.   Photo, unlike iPhoto, seems to ignore DNG files and only imports JPG files when both are present on the SD card.  JPGs are used for quick proofing on an iPad.    DNG RAW files are edited on a Mac Pro (2013).    Other than deleting the JPGs before importing images from the SD card,  is there any way to force Photo to select and import only the DNG images?

    Thanks Larry,
    I did see the J stacked in the lower left of the thumbnails but couldn't figure out how to get to whatever is below it.   How do you select R?  
    I use an iPad to do quick proofs of my images.   A JPG is good enough for a proof ( dust on the lens,  composition, blown out image, etc. ).   The iPad is JPG friendly and can load the images quickly.    Serious editing takes place on my Mac Pro with the DNG files.   I use the same workflow with the the Leica M 240.   iPhoto has been a quick and easy importer to the Mac capturing all of the metadata in the EXIF sidecar file ( location, date, time,  camera settings, lens type).  A quick scan in iPhoto for the "keepers" let's me export those worth editing to Lightroom/Bridge/Photoshop.  I typically shoot 50 images from three locations in a normal day.  If I'm lucky I'll get 1 worth real work to add to the portfolio.  

  • After upgrading to the latest version of itune, I get this message when trying to open itunes: "The I'tunes Library File is locked, on a locked disk, or you do not have permission to write for this file.

    After importing the latest version of itune, I now get this message:  "The I-tunes library file is locked, on a locked disk , or you do not have permission to write for this file.  How do I resolve this?

    check if you have read & write permissions for your music folder. in the finder, right-click on it and get info. unlock the little padlock (you may have to enter your admin password) and change the permission settings if necessary. next, click on the little gear-shaped icon and apply to enclosed items like so
    the important part is to apply to enclosed items !
    also, even if it seems unrelated, try the steps in this support article: iTunes: Missing folder or incorrect permissions may prevent authorization

  • How can I quickly view pdf files like I can do with Windows Picture and Fax viewer for jpg files?

    How can I quickly view pdf files like I can do with Windows Picture and Fax viewer for jpg files? I need to look at several thousand PDF files. It takes too long to open each one individually. The only thing I could think of is combining them into large groups and then using the Navigation index. But I like the way windows Picture and Fax Viewer does it because you can keep the files separate. Combining PDFs causes loss of individual file names. That would be a problem since I do need to have the individual file names.

    Windows Picture and Fax Viewer is a DLL and is started via a rundll32.exe call and can't be set as an application to handle images in Firefox 3 and later versions.
    Try to set Windows Picture and Fax Viewer as the default viewer in Windows, then it should be listed automatically in the Mozilla Firefox Browse dialog.
    *http://www.winhelponline.com/articles/115/1/Windows-Picture-and-Fax-Viewer-as-the-default-viewer-in-Mozilla-Firefox.html
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''

  • The volume for "*.jpg" cannot be found. External harddrive.

    I have recently purchased a MacBook Air and have moved my iPhoto library to an external harddrive. Recently, my all of my older photos and videos when clicked on come with the error "The volume for "*.jpg" cannot be found." However, my new imported photos do not have this problem. When I click "Find Photo" and select that photo on my harddrive, it still gives me the same error.
    I have many photo albums and would rather not import them all again just to re-organize them. Do I have any other alternatives?

    Are you running a Managed or a Referenced Library?
    A +Managed library+, is the default setting, and iPhoto copies files into the iPhoto Library when Importing
    A +Referenced Library+ is when iPhoto is NOT copying the files into the iPhoto Library when importing because you made a change at iPhoto -> Preferences -> Advanced. In this scenario you are responsible for the File Management.
    Regards
    TD

  • Recommendations, please, for external DVD writer for my 2006 iMac. (Internal drive unable to write coherently.)

    Recommendations, please, for an external DVD writer for my 2006 iMac whose internal drive is writing unreadable discs. 
    Model Name:          iMac
      Model Identifier:          iMac5,1
      Processor Name:          Intel Core 2 Duo
      Processor Speed:          2.16 GHz
      Number Of Processors:          1
      Total Number Of Cores:          2
      L2 Cache:          4 MB
      Memory:          4 GB
      Bus Speed:          667 MHz

    Thanks, A Brody.  Don't know what the PRAM battery is.  Here are more details of the fault ... Although I've had the iMac for 5 years this may be the first time I've tried copying a video recording onto the DVD drive (I've made lots of CD copies without a problem).  The folder and files all seem to be reproduced in identical order on the disc but my domestic DVD player cannot make sense of the recording, unlike the original source DVD from which the files originated.  The drive has always been noisy but I've never assumed it shouldn't be!  Does this fit your PRAM battery theory?  If so, please explain more.  Thanks.

  • Where can I find a pdf writer for my new macbook air?

    Where can I find a pdf writer for my new macbook air?

    If you'd like to create a PDF from something rather than print, you can create a pdf from any print dialog.
    ie. File > Print > click PDF button lower left > Save as PDF..

  • How do I make Photoshop the default Edit App for .jpg in Windows 7?

    How do I make Photoshop the default Edit App for .jpg in Windows 7?    I want to be able to right click on a .jpg file, select the EDIT option in the Context Menu, then have Photoshop edit the file instead of Paint.
    In Windows XP it was very easy to use the File Manger to associate the file type .jpg and action edit with Photoshop.    No so easy in Windows 7.  It is easy to change the default OPEN application, but I would like to leave Windows Viewer as the default OPEN application and have Photoshop as the EDIT applicaiton.

    Before I posted the original question here, I had probably spent a couple of hours trying to research it.   I hate to find no answer for something I know can be done.   So I spent some more time and found the following in the bowels of a Tech Forum that is generally way over my head.  I have modified it to be Photoshop specific.
    These instructions will update the default EDIT action for image types - jpg,png,gif and the variations.     If you are unfamiliar with editing the program registry you probably will want to back up your registry or take a system backup.
    1. Open up the registry editor (Regedit.exe).
    You will need to be signed on as a Windows user that is an administrator
    2. Find HKEY_CLASSES_ROOT -> SystemFileAssociations -> image ->  shell -> edit -> command
    This seems like it would be easy but it is not, because there are many key names that are very close (like System.FilesAssociations).   Keep looking because you will find it eventually. 
    3. Double click on "Default" (on right window pane) and update the program location.
    You should see that MSPAINT.EXE is the current program.
    Erase the existing value and enter you photoshop location in quotes followed by %1 in quotes.  For me this is "C:\Program Files  (x86)\Adobe\Adobe Photoshop CS4\Photoshop.exe" "%1"  
    Hit return.
    4.  Exit Regit and test.

  • I'm trying to update iOS 7 and it says I need 3.4 GB of storage to update.. I currently have on my storage 797 MB and 12,6 GB used. How much storage should it write for me to be able to update?

    I'm trying to update iOS 7 and it says I need 3.4 GB of storage to update.. I currently have on my storage 797 MB and 12,6 GB used. How much storage should it write for me to be able to update?

    If your ipad has only 797 MB free and it tells you that you need 3.4 GB to update, then you need to begin deleing files, whatever it takes to free up space.
    Consider...
    Delete apps you don't use.
    Delete videos you don't want (these take up a lot of space).
    Do you have a lot of emails stored on the device?
    Are there apps that store data files, like a PDF reader?  If there are a lot of these, you need to delete some.
    The bottom line is that you need to remove data and/or apps on your device to make more storage available.
    But for videos and photos, always sync them to a computer first to archive them.

  • Check writer for HR PAYROLL

    Can any one clarify that check writer and check writer(xml) concurrent programs that are used for payroll check printing are same? if not when should we use check writer and when should we use check writer(XML)? (why i am asking these because concurrent program short name which is the code for data definition and template are not same,but the data definition name( Check Writer XML) is same for template(Check Writer for US))
    To Enable check writer(XML) i gone through some setups in oracle support should that be performed to use check writer(XML) instead of check writer? and finally to customize my check template where can i get the XML DATA ? Any replies will be appreciated thanks in advance.

    There are several documents on Metalink that provide the steps necessary for using CheckWriter(XML). Basically, the CheckWriter and the CheckWriter(XML) programs are the same however the XML program runs through the Oracle provided data definitiion and xml template to produce the PDF output.
    When you run the Check Writer (XML) program you will find two programs in the Concurrent Request window. The PDF output from the template will generate from the 1st program and the XML data that is used to generate is found in the 2nd program. You can copy the seeded Oracle XML check template and rework it to fit your organizations requirements.
    ~RL

  • Fireworks as default app for jpg files

    I was able to configure Fireworks to be the defaul app for jpgs - and when I click on a jpg file in my file manager, - Fireworks launches - but the image file that I clicked on does not open. 
    I like to be able to find a file using Windows Explorer (using Windows 7) and then click on it to launch in Fireworks - although it worked with 5.5 - it is not working with 6.0. 
    What am I doing wrong?

    I tested this on my Windows 7 system and it worked okay with the method I described. Fireworks wasn't in the list so I had to hit the Browse button and direct it to the Fireworks.exe after which double-clicking a jpeg image opened the image in Fireworks CS6. This functionality is a feature of Windows not the Adobe software. All of the file associations are based off of related Windows registry entries.
    Things you could try
    1) Specify a different default app like Windows Picture and Fax viewer and then try switching it to Fireworks CS6 again
    Not an official Adobe solution, try at your own risk!
    2) Try resetting the file assocations to the Windows defaults then associating it again
    Had you deleted jpeg previously?
    I found this, haven't had a needed to test the solution out myself but might be what you need
    http://answers.microsoft.com/en-us/windows/forum/windows_7-files/how-can-i-restore-the-def ault-file-associations-in/c096cd7a-91cd-4460-af4d-f38d7ca54860
    -Dave

  • Best external DVD writer for iMac

    What is the Best external DVD writer for iMac

    i use the apple superdrive its expensive but its good quality no blueray though. I love it though.

  • Creating a Library in Report Writer for FI-SL

    Hello everybody,
    When creating a library (table ZZGLTRS) for Report Writer for FI-SL I have the following message:
    "Table ZZGLTRS is not installed in Report Writer" and the description of the message says:
    "The Report Writer can only report on tables if the attributes of these tables that are relevant for reporting are defined in control tables. This is not the case for table ZZGLTRS"
    Does anybody knows what does this "control tables" mean? Should I activate this ZZGLTRS table somewhere to be used in report Writer?
    Thanks in advance!!!
    Adela.

    Update table T804A via SM31

  • Compiling "write to jpg\bmp\png file" in Labview2011

    Hello everyone,
    I'm trying to compile a source code written in Labview 8.5 into Labview 2011.
    In the old source code I used the "write BMP/JPG/PNG file" VIs.
    I noticed that these VIs have changed in Labview 2011.
    Either way (using the old or new VIs) I get an error (#1003 - Vi is not executable) when I try to run my compiled .exe file.
    Did anyone encounter this problem?
    Do you have any idea how to bypass this problem?
    Thanks in advance.

    Mentos wrote:
    I have LABVIEW 2011 Runtime engine installed.
    I even reinstalled it, but the problem still remains.
    Could it be you only installed the minimum run time engine (~32MB)? You definitely need the std (~210MB).
    LabVIEW Champion . Do more with less code and in less time .

Maybe you are looking for