Crop jpegs with Applescript

Hi can anyone please advise, I am wanting to crop jpgs using image handler and applescript.
I am wanting to save (crop) only the right hand side off the original.
I found the fllowing script came close but it crops to the centre not from the centre to the right can anyone advise?
thanks.
set this_file to choose file without invisibles
set the vertical_crop to 0
set the horizontal_crop to 0.50 -- 50%
try
tell application "Image Events"
-- start the Image Events application
launch
-- open the image file
set this_image to open this_file
-- get dimensions of the image
copy dimensions of this_image to {W, H}
-- perform action
crop this_image to dimensions {W - (W * horizontal_crop), H - (H * vertical_crop)}
-- save the changes
save this_image with icon
-- purge the open image data
close this_image
end tell
on error error_message
display dialog error_message buttons {"Cancel"} default button 1
end try

Ok Guys I found a partial solution for anyone interested.
As I stated in an earlier post I found Adobe Photoshop could do everything required such as scale,crop and save as jpeg etc.
So I created a droplet from the action to perform this to my needs.
I then installed Hazel <http://www.noodlesoft.com/hazel.php>
This enabled me to watch a folder for files added, also creating a rule thats run the Photoshop droplet on items added to the watched folder.
Everything processes just as I had hoped.
The only downside is I need another license for Photoshop but the workflow works!
I hope this update can help anyone else with a similar requirement.
Many thanks again to Frank and particularly Neville for the help and advise offered without which I would have thrown my much loved MacBook out of the windows days ago!!

Similar Messages

  • Export current document as jpeg with applescript

    I am trying to script illustrator CS3 to export the current document as a jpeg file, to the same location as the current file was opened from, with the same filename, only changing the extension from .ai to .jpg, if a jpeg file already exists, it should overwrite the existing one...
    the script should also save the current document, without closing it...
    I have not been able to figure this out reading the illustrator applescript reference...
    Any help would be appreciated...
    -Rich

    Hi Richard,
    I'm not sure about Applescript, but i've found Illustrators export via javascript pretty crappy. I ended up exporting to PSD, launching photoshop and exporting our of photoshop via javascipt.
    I hope someone tells me I am wrong.
    Regards
    Norbert

  • Download image from URL with applescript

    I want to download an image from an website (and internal IP address) using applescript,
    now I have found a script that works (Download jpeg image to folder with AppleScript from URL).
    But, the web page requires a username and password...
    When I convert the downloaded JPEG into a HTML by simply changing the extension, quick look displays the webpage's 401 unauthorized error page...
    Does someone know how to make the applescript input the username and password?

    The answer depends on how the authentication is managed.
    There are two common ways of implementing authentication in web browsers and knowing which one is used here is essential to scripting the request. One is also significantly harder than the other.
    The first (easy) way is that the username and password can be submitted with the request. This is the original model and is easy to script - if you're using the curl model then it's just a matter of adding the -user switch to the command line:
           -u, --user <user:password>
                  Specify the user name and password to use for server authentica-
                  tion. Overrides -n, --netrc and --netrc-optional.
    This model is a little less secure, though, but might still be used on internal sites since it's easy to implement.
    The other option is that the site uses cookies - you log in via a web form and the server gives your cookie which you then send with subsequent requests and are used to validate your access. This is a more secure, but is harder to implement because there is a multi-step process - login via the web form, capture the cookie, submit the cookie with the download request.
    If you're not familiar with the different methods it can sometimes be hard to tell which one you need, and since it's an internal site there's no way anyone else can check... so you'll need to describe how you login to the site (or are prompted for authentication) before anyone can provide a direct answer.

  • Crop Image using applescript?

    Hi all
    I'm trying to set up a script that will batch crop a bunch of files to 320X320 (album artwork size). However, I have yet to come across a sample/tutorial of how to set up the actual crop commands. Is cropping images even possible with applescript?

    You're right it does work now!
    I've tried to adapt Camelot's code to my version of the script but for some reason, the images don't get cropped.
    here is my code so far:
    -- global variable declarations
    global _widthHeight
    global _folderA
    global _folderB
    global _workFilesInA
    global _workFilesInB
    global _theImage
    set _widthHeight to the text returned of (display dialog "Enter dimension for width and height:" default answer "320")
    set _folderA to (choose folder)
    tell application "Finder"
    set _workFilesInA to every file of folder _folderA
    end tell
    tell application "Finder" -- creation of temporary folder
    if (the folder "path:processedImages" exists) then
    set _theAns to the button returned of (display dialog "A folder named processedImages already exists." buttons {"Cancel", "Yes"} default button "Yes")
    if _theAns is "Yes" then
    tell application "Finder"
    delete the folder "path:processedImages"
    set _folderB to (make new folder at "path:Desktop:" with properties {name:"processedImages"})
    end tell
    end if
    else
    set _folderB to (make new folder at "Path:Desktop:" with properties {name:"processedImages"})
    end if
    end tell
    -- work code
    if (count of _workFilesInA) is not 0 then
    repeat with i from 1 to count of _workFilesInA
    try
    tell application "Finder"
    duplicate item i of _folderA to _folderB
    end tell
    on error errmess
    display dialog "This error occured: " & errmess
    end try
    end repeat
    end if
    tell application "Finder" -- crop files in temporary folder
    set _folderB to "Path:processedImages"
    set _workFilesInB to every file in folder _folderB
    tell application "Image Events"
    repeat with i from 1 to count of _workFilesInB
    crop item i to dimensions {_widthHeight, _widthHeight} **********
    save item i
    end repeat
    end tell
    end tell
    everything works up to the **********. The events log tells me that the items were cropped (it even cycles through the), but upon inspecting the images, no cropping is evident.

  • "Save image" button of Camera Raw does not save JPEG with modifications made.

    I am using Bridge CC to process my RAW images and make modifications to some JPEG images as well.  I have no need to further alter images in Photoshop at the moment, so I do all modifications in Camera Raw. After altering my images, I then press the "save image" button at the left bottom corner of Camera Raw and choose the settings to save in JPEG.  However, when I upload these JPEG images to a website or when I email them, the image is uploaded without the modifications I had done!  It seems to me that Camera Raw is saving JPEGs the same way it does for RAW images, in a non-destructive manner, only attaching instructions for the images to be displayed properly on Photoshop. But when I save an image in JPEG, I expect the image to be saved entirely with the modifications I made while still keeping the original RAW file.  What goes on then?  What is Camera Raw doing and how do I get to save a modified image in JPEG with Camera Raw?  Would you please explain?
    Many thanks for your help,
    Beza

    Hi,
    What version of camera raw and operating system are you using?

  • Can not add function to pages-document created with Applescript

    If I create new document using the GUI (New document) I can place the cursor within any table-cell, type "=" (equal sign) and f.e. "2+2" which will result in a cell showing a "4".
    If I create a document with Applescript, I can not add new functions (neither by typing = nor by using Insert >> Function (may be different, I have German version here). Already existing functions (which already were in the template) can still be used and work as expected but can not be altered.
    Any idea?
    I use Pages '08, Version 3.03
    Code I used to create the document:
    tell application "Pages"
    launch
    make new document at front with properties {template name:templateName}
    # Angebotsnummer ins Dokument schreiben
    tell body text of front document
    make new paragraph at after paragraph 1 with data angebotsNr
    set paragraph style of paragraph 2 to "Überschrift"
    end tell
    # Datei abspeichern
    set dateiName to missing value
    repeat until dateiName is not equal to missing value
    set dateiName to text returned of (display dialog "Datei Name:" default answer angebotsNr & "_" & kundenName) as text
    end repeat
    save front document in angebotsOrdner & dateiName
    end tell

    I apologize but the given script can't run.
    The variable templateName is undefined.
    The variable angebotsNr is undefined too.
    About the described behavior, it's a bug which I never discover before.
    It's always striking in Pages '09.
    Here is the report which I filed :
    Bug ID# 8704270
    Summary:
    +Odd behavior of tables in Pages documents created by a script+
    +Steps to Reproduce:+
    +Run this huge script+
    +tell application "Pages"+
    +make new document at front with properties {template name:"Blank"} (* "Vierge" on French systems *)+
    +end tell+
    +Insert a table+
    +try to insert a formula+
    +Expected Results:+
    +I assumed that I will get the formula editor which I get when the document is created by hand+
    +Actual Results:+
    +There is no way to get the editor, no way to insert the equal character.+
    +This odd behavior strike in all versions of Pages '09 and Pages '08+
    Regression:
    +None to my knowledge+
    Yvan KOENIG (VALLAURIS, France) dimanche 28 novembre 2010 11:30:29

  • Automated report/ PDF conversion with AppleScript

    Hello-
    I am attempting to PDF a spreadsheet from Dropbox, and email it to a set list of recipients with AppleScript.  Much of this I have been able to figure out, but I am having some issues with the PDF conversion.  As you can see below, I am still working on sending the xls file, and have not yet been able to get AppleScript to convert a specific tab of the file to aPDF.  I expect scheduling to be handled theough crontab.
    Current script is as follows:
    tell application "Finder"
              set folderPath to folder "Macintosh HD:Users:user:Dropbox:folder:Calculated PO Sheet"
              set theFile to first file in folderPath as alias
              set fileName to name of theFile
    end tell
    set theSubject to "Current PO Report" date
    set theBody to "See attached."
    set theAddress to "recipient email"
    set theAttachment to "CALCULATED PO SHEET.xlsx"
    set theSender to "sender email"
    tell application "Mail"
              set theNewMessage to make new outgoing message with properties{subject:theSubject, content:theBody & return & return, visible:true}
              tell theNewMessage
                        set visibile to true
                        set sender to theSender
      make new to recipient at end of to recipients with properties {address:theAddress}
                        try
      make new attachment with properties {file name:theAttachment} at after the last word ofthe last paragraph
                                  set message_attachment to 0
                        on error errmess -- oops
      log errmess -- log the error
                                  set message_attachment to 1
                        end try
                        log "message_attachment = " & message_attachment
      #send
              end tell
    end tell

    Hi,
    there is a special setup for this requirement. Please see the following support note
    Reference
    Oracle Reports Output For Indian Languages Like Gujarati, Marathi [ID 980554.1]
    Roberto

  • Is there a way to edit IPTC data of an image with AppleScript?

    Hi,
    I'm looking for a way to batch-edit the IPTC data from images. Is that somehow possible with Applescript? If so, could someone point me to a direction?
    (I fond a script working wit Graphic Converter in another thread, but that didn't work.)
    Thanks,
    p.

    Frank, maybe you could give me a hand here. I'm building the basic script cycling through the dropped files. But I don't know how to best implement the terminal command.
    In each cycle, I would set the file path as a variable and then compose the terminal command in order to execute it with "do script".
    But  "set x to path of eachFile" doesn't work: <<class ppth>> of alias "(path shows here)" could not be read. Any ideas how to do that better?
    on open theFiles
      repeat with eachFile in theFiles
                        set x to path of eachFile
                        tell application "Terminal"
                         activate
                        do script "hello" (Exiftool command will be here)
                        close window 1
                        end tell
              end repeat
    end open

  • Help with Applescript - filenames

    Hi!
    I hope there is someone who can help me. I have very little experience with Applescript, and have spent a couple of days scouring these forums amongst others without any luck...
    I have a folder (titled XLS) with about 1000 excel files in it. They are numbered basen on some parametric calculations (1111.xls, 1112.xls, 1113.xls, etc). I have constructed an Automator rutine which, one at a time, can open each excel file, copy some cells and then paste the data into an empty xml-file in TextWrangler. The empty xml-file is also in the XLS folder.
    What I am looking for is an applescript which can rename the open xml-file with the same filename as the xls-file. So, when 1111.xls is open, the xml-file gets renamed 1111-xml; when 1112.xls is open, the xml-file gets renamed 1112-xml, etc. Each new xlm-file is to be saved into a folder XLM, whivh is also in the XLS folder.
    Thanks in advance....
    Rob

    Se below; there are two folders on the desktop; "xls" (with xls-files in) and "xml", as well as the empty Template.xml file. Here it is!:
      --3 XLS to XML
              tell application "Finder"
                        set fileList to every file of entire contents of ("YourHD:Users:You:Desktop:xls" as alias)
              end tell
              repeat with i from 1 to number of items in fileList
                        set currentFile to (item i of fileList)
                        tell application "Microsoft Excel"
                                  set screen updating to false
      open currentFile
      activate currentFile
      activate object worksheet 1
                                  copy range range ("YourRange")
                        end tell
                        tell application "Finder"
                                  copy file "YourHD:Users:You:Desktop:Template.xml" to folder "YourHD:Users:You:Desktop:xml"
                        end tell
                        tell application "Microsoft Excel"
                                  set docName to name of window 1
                        end tell
                        tell application "Finder"
                                  set docName2 to text 1 thru ((offset of "." in docName) - 1) of docName
                                  set theFile to "YourHD:Users:You:Desktop:xml:Template.xml" as alias
                                  set the name of theFile to docName2 & ".xml"
      open file theFile
                        end tell
                        tell application "TextWrangler"
      activate
      paste
      close text document 1 saving yes
                        end tell
                        tell application "Microsoft Excel"
      activate
      close active workbook saving no
                        end tell
              end repeat
              tell application "Microsoft Excel"
                        set screen updating to true
      quit
              end tell
              tell application "TextWrangler"
      quit
              end tell

  • Creating a Save As dialog box with Applescript for Excel 2008

    This is going to be part of a larger script. I'm trying to figure out how to make the default save location to where the file opened from and the default file name to the current filename in the dialog box.
    Here is what I go so far...
    tell application "Microsoft Excel"
    tell active workbook
    set myFile to choose file name with prompt "Save file as:"
    end tell
    end tell
    I'm very new with working with Applescript, so at this point I have been piecing together code snippets.
    Any help would be great and thank you

    The choose file name command supports a default location parameter that tells it where to open the dialog:
    set myFile to choose file name with prompt "Save file as:" default location (alias "Macintosh HD:Users:username:foldername:")
    So you need to look at the Excel dictionary to determine the path to the current file and insert it into the script. Every version of Excel has slightly different dictionaries so the version you're running is critical to getting the right syntax.

  • Save As JPEG in AppleScript

    Trying to Save a PSD file as JPEG using the script from the Adobe scripting documentation.
    The following code opens the standard Save As dialog box rather than simply saving the file, I am missing something ... but what??!
    tell application "Adobe Photoshop CC"
              set theDocument to current document
              set myFile to "Macintosh HD:Users:peterrhawkes:Desktop:MH.jpg"
              set myOptions to ¬
                        {class:JPEG save options, embed color profile:true, quality:12} ¬
      save theDocument in file myFile as JPEG with options ¬
      myOptions appending no extension without copying
    end tell

    hi peter
    I faced a general error with no further information in photoshop cc when I used your code for a try, even there was no save as dialog box.
    for me it helped to declare the destination path as string.
    tell application "Adobe Photoshop CC"
      set theDocument to current document
      set myFile to "System:Users:imac7:Desktop:MH.jpg" as string
      set myOptions to ¬
      {class:JPEG save options, embed color profile:true, quality:12} ¬
      save theDocument in file myFile as JPEG with options ¬
      myOptions appending no extension without copying
    end tell
    hope this helps.
    have fun.

  • Export PDF Workflow with Applescript and CS3

    Hello,
    I am setting up some PDF workflow with Applescript.
    On a given moment, as my script runs and after getting some user-input answers to questions in some dialogs, my script tells InDesign CS3 to open the Export Adobe PDF window for the current document. I copied and pasted that small part of the script:
    tell application "Adobe InDesign CS3"
    tell document 1
    export format PDF type to "Macintosh_HD:Test01.pdf" using "somePreset" with showing options
    end tell
    end tell
    When you run this small part of my Applescript, InDesign opens the Export Adobe PDF window (as expected) waiting for me to click on "Export". That is exactly what I want, since the user is given here a last opportunity to change some values (for example page range, or spreads). When all is set, the user can click on Export to close the dialog and finish the script.
    Problem: I was hoping that the Adobe PDF Preset "somePreset" would be selected in the first pull-down menu of the Export Adobe PDF window when this window is opened by the script. Unfortunately the last used preset is always selected by default. Anyone suggestions or help?
    Kind regards,
    Bertus Bolknak.

    My operators enter the page range and filename into a dialog box. Then I set those in the script. I use the Press Quality preset to start with and then set the changes I want into a export variable. I set things like bleed, marks, page range, etc.
    Here is an example:
    set theProps to properties of PDF export preset "[Press Quality]"
    try
    delete PDF export preset "Schmidt PDF"
    end try
    set theStyle to {name:"Schmidt PDF", acrobat compatibility:acrobat 7, bleed top:"0.125i", bleed bottom:"0.125i", bleed inside:"0.125i", bleed outside:"0.125i", page marks offset:"0.125i", include ICC profiles:Include None, effective PDF destination profile:use no profile, effective PDF X profile:"No Color Conversion"} & theProps
    make PDF export preset with properties theStyle
    set properties of PDF export preferences to theStyle
    set color bitmap sampling of PDF export preferences to none
    set grayscale bitmap sampling of PDF export preferences to none
    set page range of PDF export preferences to (item i of myPageList) as string
    export document 1 format PDF type to (PrinergyFolder & myJobNumFinal & "_" & VerCode & ".pdf") as Unicode text without showing options
    I am also doing this in Quark.

  • Create Smart Folder with Applescript?

    Hi
    Is there a way to create a Smart Folder with Applescript?
    many thanks
    LJ

    thanks neil.
    one other question. once i've made this folder i'll want to use it.
    it occurs to me that i might not be able to use the same code to
    call the folder after it's been created since, while the date may
    be the same, the time won't be.
    how do i stored the new folder name as it's being created so that
    i can call it later in the script?
    thanks again,
    BabaG

  • I can't seem to "close" my documents on MSoft Word with AppleScript!

    Hi
    I have tons of documents open on MSoft Word and wish to close some of them. Luckily, those that I wish to close all start with the word "book", so I was thinking I could actually automate that with AppleScript hence avoid closing them one by one.
    I wrote the following code:
    tell application "Microsoft Word"
    count (document)
              set countresult to result
              repeat with incrementValue from 1 to countresult
                        if name of document incrementValue starts with "book" then
      activate document
      close document
                        end if
              end repeat
    end tell
    To my surprise, it didn't work!
    I got the following under "Replies", which showed that AppleScript did indeed try to close the document that starts with "book":
    tell application "Microsoft Word"
    count every document of current application
      --> 6
    get name of document 1
      --> "book_mac_OS_X_and_iOS_internals.htm"
    activate
    close document
    get name of document 2
      --> "applicable books.htm"
    get name of document 3
      --> "What Do You Want Homespace to Do.htm"
    get name of document 4
      --> "URL_repository_for_outcomes.htm"
    get name of document 5
      --> "SYNTHESIS - History a Step Back.docx"
    get name of document 6
      --> "SYNTHESIS - History a Step Back.docx"
    end tell
    But when I went back to Word, I still saw the document there!
    I actually added an additional line (I didn't include the code in that which I pasted here) asking to count the number of documents in Word AFTER the so-called "close", and the number remains 6.
    Can anyone enlighten me on this?
    Regards,
    junxiang99

    Hi,
    The quickest way to do this (tested with OS 10.8.2, MS Word 2011) is in one line:
    tell application "Microsoft Word" to close every document whose name begins with "book"
    The reason why your script doesn't work is that you aren't specifying to Word which document you want it to close.
    So, changing one line ought to do it:
    close document incrementvalue -- instead of "close document"
    But... when you close a document, you change the document count. Document 2 becomes document 1, document 3 becomes document 2 etc. So eventually you'd get a message saying "The object you are trying to access doesn't exist".
    Because of this, if you want to do it in a repeat loop, you have to work backwards:
    tell application "Microsoft Word"
      set doc_count to count documents
      repeat with x from doc_count to 1 by -1
      if name of document x begins with "book" then close document x
      end repeat
    end tell
    Hope this helps.

  • How to read and write Png and jpeg with  Alpha

    Hi
    I have trouble reading and writeing PNG and JPEGs that have an alpha channel (for transparency).
    Reading works, if i use Toolkit.getImage() method, but works NOT if i use ImageIO.read() method.
    Writing does NOT work using ImageIO.write()method. Instead i got a "java.lang.UnsupportedOperationException: Unsupported write variant!"
    See Test class and commandline output below:
    /****************START*****************************/
    package de.multivisual.bodo.test;
    import java.awt.*;
    import java.awt.image.*;
    import java.io.File;
    import java.net.URL;
    import java.util.Iterator;
    import javax.imageio.*;
    import javax.imageio.metadata.IIOMetadata;
    import javax.imageio.stream.ImageInputStream;
    import javax.imageio.stream.ImageOutputStream;
    public class AlphaChannelTest implements ImageObserver {
      Toolkit toolkit;
      Image img;
      public AlphaChannelTest() {
        super();
        toolkit = Toolkit.getDefaultToolkit();
        URL url =
          AlphaChannelTest.class.getResource(
            "/de/multivisual/bodo/test/" + "alphatest.png");
        img = toolkit.getImage(url);
        try {
          ImageInputStream imageInput =
            ImageIO.createImageInputStream(url.openStream());
          Iterator it = ImageIO.getImageReaders(imageInput);
          ImageReader reader = null;
          while (it.hasNext()) {
            reader = (ImageReader) it.next();
            System.out.println(reader.toString());
          reader.setInput(imageInput);
          ImageReadParam param = reader.getDefaultReadParam();
          BufferedImage bimg = reader.read(0, param);
          SampleModel samMod = bimg.getSampleModel();
          ColorModel colMod =       bimg.getColorModel();
          String[] propNames = bimg.getPropertyNames();
          IIOMetadata meta = reader.getImageMetadata(0);
          System.err.println("\n*****test image that was read using new Jdk 1.4 ImageIO.read() method");
          alphaTest(bimg);
        } catch (Exception e) {
          //e.printStackTrace();
        if (img != null)
          toolkit.prepareImage(img, -1, -1, this);
        try {
          synchronized (this) {
            System.out.println("wait");
            this.wait();
        } catch (Exception e) {
          e.printStackTrace();
        System.out.println("end");
      public void alphaTest(BufferedImage bi) {
        Raster raster = bi.getData();
        float[] sample = null;
        System.out.println("raster :");
        for (int y = 0; y < raster.getHeight(); y++) {
          for (int x = 0; x < raster.getWidth(); x++) {
            sample = raster.getPixel(x, y, sample);
            System.out.print("(");
            for (int i = 0; i < sample.length; i++) {
              System.out.print(":" + sample);
    System.out.print(")");
    System.out.println();
    Raster araster = bi.getAlphaRaster();
    if (araster == null){
         System.err.println("there is no Alpha channel!!!!!!!!!");
         return ;
    } else {
         System.out.println("Alpha channel found !");
    float[] asample = null;
    System.out.println("raster alpha:");
    for (int y = 0; y < araster.getHeight(); y++) {
    for (int x = 0; x < araster.getWidth(); x++) {
    asample = araster.getPixel(x, y, asample);
    for (int i = 0; i < asample.length; i++) {
    System.out.print(" " + asample[i]);
    System.out.println();
    String format ="PNG";
    System.out.println("##########Test Writing using new JDK1.4.1 ImageIO:");
    Iterator writers = ImageIO.getImageWritersByFormatName(format);
    ImageWriter writer = (ImageWriter) writers.next();
    ImageWriteParam param = writer.getDefaultWriteParam();
    ImageTypeSpecifier imTy = param.getDestinationType();
    ImageTypeSpecifier imTySp =
    ImageTypeSpecifier.createFromRenderedImage(bi);
    param.setDestinationType(imTySp);
    File f = new File("c:/tmp/myimage."+format);
    try {
    ImageOutputStream ios = ImageIO.createImageOutputStream(f);
    writer.setOutput(ios);
    writer.writeInsert(0, new IIOImage(bi, null, null), param);
    } catch (Exception e) {
         System.err.println("could not write "+format+" file with alpha channel !");
    e.printStackTrace();
    public boolean imageUpdate(
    Image img,
    int infoflags,
    int x,
    int y,
    int width,
    int height) {
    if ((toolkit.checkImage(img, -1, -1, null)
    & (ImageObserver.HEIGHT | ImageObserver.WIDTH | ImageObserver.ALLBITS))
    == 35) {
    int iw = img.getWidth(this);
    int ih = img.getHeight(this);
    BufferedImage bi = new BufferedImage(iw, ih, BufferedImage.TYPE_4BYTE_ABGR);
    Graphics2D big = bi.createGraphics();
    big.drawImage(img, 0, 0, this);
    System.err.println("+++++test image that was read using old Toolkti.getImage method");
    alphaTest(bi);
    synchronized (this) {
    this.notifyAll();
    return false;
    return true; // image is not yet completely loaded into memory
    public static void main(String[] args) {
    //     BufferedImage image = new
    // BufferedImage();
    new AlphaChannelTest();
    /*************************END********************/
    The commandline looks like this:
    [i]
    com.sun.imageio.plugins.png.PNGImageReader@d1fa5
    *****test image that was read using new Jdk 1.4 ImageIO.read() method
    raster :
    there is no Alpha channel!!!!!!!!!
    wait
    +++++test image that was read using old Toolkti.getImage method
    raster :
    Alpha channel found !
    raster alpha:
    ##########Test Writing using new JDK1.4.1 ImageIO:
    could not write PNG file with alpha channel !
    java.lang.UnsupportedOperationException: Unsupported write variant!
         at javax.imageio.ImageWriter.unsupported(ImageWriter.java:600)
         at javax.imageio.ImageWriter.writeInsert(ImageWriter.java:973)
         at de.multivisual.bodo.test.AlphaChannelTest.alphaTest(AlphaChannelTest.java:113)
         at de.multivisual.bodo.test.AlphaChannelTest.imageUpdate(AlphaChannelTest.java:135)
         at sun.awt.image.ImageWatched.newInfo(ImageWatched.java:55)
         at sun.awt.image.ImageRepresentation.imageComplete(ImageRepresentation.java:636)
         at sun.awt.image.ImageDecoder.imageComplete(ImageDecoder.java:135)
         at sun.awt.image.PNGImageDecoder.produceImage(PNGImageDecoder.java:511)
         at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:257)
         at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:168)
         at sun.awt.image.ImageFetcher.run(ImageFetcher.java:136)
    end

    in between i found out that the my png and jpeg test images did not have an alpha channel, since the tool i used to create them, did not write the alpha channel to disk.
    if i use png with alpha channel, then the read works correktly with ImageIO.read()
    however the read problem still remains for gifs and the write does not work for gifs and neither for pngs.
    whether jpegs can be read with alphachannel i don't know since i don't have a tool to create jpeg with alpha channel. (at least gimp and corel9 are not able to )
    and it is not possible to write the previous read png with alpha channel back as and jpeg with alpha channel

Maybe you are looking for

  • Help needed: Disk space does not free up even after deleting files.

    Background information for this problem: I have my iPhoto library on an external HD, and was importing files from that same drive into iPhoto, and began receiving messages that I was very low on disk space on my internal HD. From here, it seemed like

  • Airport simply not working :( PLEASE HELP!!

    I have macbook OS X 10.5.6, and recently acquired an airport (4.1) from my grandmother, who has a slightly earlier version of the macbook. I decided i want to try to use it to print. I plug it in and it comes up in my network as 'sue's airport'(it wa

  • Current emails open up to show old emails from 2008

    A couple months ago I opened an email from my son, but it opened up an email that I received from someone else in 2008. This happened maybe twice more until today. My son sent me an email this morning and when I opened it, it was an email that I rece

  • How do you change Apple ID in Update Section?

    I need it help it really annoys me that I can't update my Apps?!?!?! It keeps showing my sister's apple ID. I've tried deleting settings, and loging off and back on!!

  • How can I stop Shockwave Flash from crashing?

    For the last few days I have been experiencing a problem viewing videos on web pages. The error message "The following plug-in has crashed: Shockwave Flash" appears across the top of the page and all the videos are black with a white logo in the midd