New Image("...") in JavaFX 2.2b11

In JavaFX 2.2b11 Image constructor does not accept file path.
In JavaFx 2.1.1 the following line works, but not in 2.2b11:
new Image("image/1.jpg");To make it work in JavaFx 2.2b11 I have tried:
new Image("file://image/1.jpg");Is such a restriction permanent and planned?
Or maybe it is just an issue in beta?

From this Jira:
http://javafx-jira.kenai.com/browse/RT-18291 "Image class should recognize a URL beginning with a leading slash as relative to the classpath"
After discussion with Richard Bair, we decided to change the current (undocumented) behavior for paths. Currently, they are treated as user.dir relative. All path, with or without leading slash will be now resolved as relative to classpath, which will be consistent with CSS and more corresponds to what might users expect.
For user.dir relative paths, "file:" URL can be still used.See also:
http://javafx-jira.kenai.com/browse/RT-21515 "Image JavaDoc does not document url relative path behaviour"
I think the code below should work in JavaFX 2.2, but the behaviour is different (lookup is versus the classpath rather than the filesystem).
If the lookup in a late build of 2.2 does not occur relative to the classpath, then it would be a bug.
new Image("image/1.jpg");

Similar Messages

  • Loading Images in JavaFX

    Can someone please explain how to load images in JavaFX? Or point me to a tutorial?
    All the answers I've seen use the __DIR__/imagename.ext to get the image. However, I have a decent sized project and do not want all my images in the same package.
    src/package/FXClass
    src/resources/images/imagename.ext
    Please, what do I do to load 'imagename.ext' in the JavaFX class 'FXClass'?
    Thanks.

    __DIR__ is a URL. It could be an http:, jar: or a file: URL. If it's a jar: URL, then it's going to be something like:
    jar:file:/my/project/path/dist/myproject.jar!/java/mainYou can use the java String API or java URL API to make a new URL of jar:file:/my/project/path/dist/myproject.jar!/java and set your ROOT variable to that.
    This code from the media browser tutorial (from Constants.fx) does something similar. Notice the javafx.application.codebase property. When you run the tutorial from javafx.com, the codebase is http://javafx.com/docs/tutorials/mediabrowser/dist/ and all of the sample thumbnails and images are in thumbs and images directory (respectively).
    * When running as an application or launcing in the browser from NetBeans,
    * the sample images and thumbnails can be loaded from the jar file. But when
    * deploying as an applet, putting all of these images in the jar file
    * would bloat the jar file unnecessarily. In the applet case the images
    * should be loaded from a server.
    * <p>
    * When running in the browser, the javafx.application.codebase property will
    * be set to the applet's codebase URL. For the Media Browser tutorial, the
    * sample images and thumbs are stored in directories rooted at this URL.
    * The javafx.application.codebase property can be used, therefore, to locate
    * the sample images and thumbnails.
    package def CODEBASE : String = {
        var codebase = FX.getProperty("javafx.application.codebase");
        // If we don't have a codebase defined, or codebase starts with "file:",
        // assume we're running locally and load images from the jar.
        if ( codebase == "" or codebase.startsWith("file:") ) {
            codebase = __DIR__
        codebase
    }

  • Is ImageIO going to be the default way to save images in JavaFX

    I have noticed that in examples where we save images to files from JavaFX (for example screenshot and then save out), ImageIO is used. There are still areas where ImageIO lags behind the now essentially dead JAI libraries (which do a much better job on Png compression sizes and you need for JPEG2000). Is the long-term plan for JavaFX
    1. to have a new way to save images from JavaFX (to avoid bouncing then through a BufferedImage)
    2. develop ImageIO more.
    3. Leave it for third-party developers to fill the gap.
    Image support has been stagnant on the Java platform (and it was lacking in several areas to start with). So it would be really helpful to know Oracle's plan (if there is one).

    Thanks for the suggestions as to setting the default values for "view options" - but I have been doing exactly as you describe and the default - at least for the main hard drive folder - doesn't hold. I want to see all my folders in list view, but every time after I shut down my Mac and then restart and open the main hard drive folder for my MacBook Pro (early 2008), it opens in icon view and I have reset its vie default to list view. I've had to do this almost every day for three months (I chose Always show as List in the Finder toolbar, check the Always show as List, modify one list option so the "Use as Default" option is active and then select Use as Default). Note that the default list view seems to be sticking with some of the folders I use more regularly - or created in list view.
    Do you know how I can get the hard drive window to hold the list view as the default?
    Thanks for your help.

  • How do I add a new Image to the Web App Module Portfolio after I went Live?

    Im pretty new to web building and I push a site live for my client and they want me to constantly update the site with new images but I cant seem to add or change any of the pics in portfolio or in carousel. Can someone help me please...

    Hi,
    Can you provide an example? So we can have a look of your existing set-up and help point you in the right direction to help update these images.
    Kind regards,
    -Sidney

  • I am used to that when I open an image in Bridge it will be opened in PS, with all preferenses I have done to the image. Now it opens in PS but without any changes i have don e in Bridge. Also when I open a new image I want it to be opened in Camera Raw a

    I am used to that when I open an image in Bridge it will be opened in PS, with all preferenses I have done to the image. Now it opens in PS but without any changes i have don e in Bridge. Also when I open a new image I want it to be opened in Camera Raw automatically, both if a Jpeg or Raw picture.
    Using PS CC
    Regards BOJ

    <moved from Adobe Creative Cloud to Bridge General Discussion>

  • After creating a new image of my project burned from iDVD I get no audio when I import it back into iMovie HD 6.0.3

    I need to edit my project after I have already burned the project. I deleted the files after being burned to save space on my hard drive. So I made a new image of the burned project with disk utility. I opened up iMovie HD 6.0.3 and imported the movie but I get no audio and the audio folder for new disk image doesn't have anything in the folder. Any help is greatly appreciated!!!

    You need to convert the VOB files in the TS-Folder of the DVD back to DV which iMovie is designed to handle. For that you need mpegStreamclip:
    http://www.apple.com/downloads/macosx/video/mpegstreamclip.html
    which is free, but you must also have the  Apple mpeg2 plugin :
    http://www.apple.com/quicktime/mpeg2/
    which is a mere $20.
    Another possibility is to use DVDxDV:
    http://www.dvdxdv.com/NewFolderLookSite/Products/DVDxDV.overview.htm
    which costs $25.
    For the benefit of others who may read this thread:
    Obviously the foregoing only applies to DVDs you have made yourself, or other home-made DVDs that have been given to you. It will NOT work on copy-protected commercial DVDs, which in any case would be illegal.

  • Disk Utility can't repair disk...Can I still create a new image to back up?

    Two days ago my computer died and I haven't been able to get past the Apple screen since. I've tried starting in Safe mode, etc. that did not work. I just started up using my installation disk and got into Disk Utility. It says it cannot repair the disk and that I should back up as many files as possible and reformat the disk.  How am I supposed to back up if I can't start up? I am currently creating a new image of the HD to an external drive but my question is if Disk Utility couldn't repair the disk, with the external drive copy also be problematic? How can I tell before I reformat the whole thing and start over?
    Please help someone! I am in a little over my head!
    Thanks

    I am currently creating a new image of the HD to an external drive but my question is if Disk Utility couldn't repair the disk, with the external drive copy also be problematic?
    Maybe.
    How can I tell before I reformat the whole thing and start over?
    Run Repair Disk on the copy.

  • Using disk utility to burn new image dvd's

    Ok I just learned to burn DVD'd using Disk Utility and New image.
    But I have come to halt in my burning with a new issue.
    My issue is that I have a file that is 4.63GB. When I make a new image so that I can burn it, it increases the size of the file(Video TS) to 5.13GB. Making it to big for a 4.7GB DVD.
    My question is is this normal for the new image file to increase in size, and is there a way for me to stop this from happening. Or can anyone give me any other suggestions. Please help.

    Ok I have never tried that, as this is the first time it is suggested to me.
    The reason i have been doing it via DU, is because this has been to only way to get it to play on
    home DVD player and burn with the UDF setting. I was told to do it this way when I was trying to burn
    copies of my nieces fifteens that was prof. done on a DVD.
    I am trying to burn a copy of a movie so that it can be played on home dvd players. Yes I have done this before and the copies I burned via DU/new image, worked perfectly. And the ones I burned by just choosing file and burning it did not work.
    So any help would be great.

  • Can Disk Utility make a "New Image" from a desktop copy of a DVD?

    I have not been able to get Disk Utility to make "new images" of a couple of DVDs. For one of the DVDs, it may have something to do with a hyphen in the title. I haven't a clue why I'm failing with the second of the two DVDs. (Previously, I've had no trouble with about a dozen DVDs so far.)
    Several members of this discussion group recommended me to copy&paste or drag&drop the files from a DVD to a new folder (say on the desktop), and then to drag the resulting new folder into the box in Disk Utility, and then to make a disk image using Disk Utility.
    (Note: While I believe the original DVDs are not encrypted, I ran an experiment to make double sure, by using MacTheRipper first to produce folders containing clean files.)
    However, when I drag the new folder into the box in Disk Utility, and let go of the mouse button, then the folder does not stay in Disk Utility window, but instead springs back to the desktop.
    How can I get Disk Utility to make new images from the new desktop folders?
    Note:
    As a partially successsful work around:
    For one of the two original DVDs - which has only about 3.7GB on it - I can sometimes (only sometimes) succeed in doing without Disk Utility simply by dragging the audio and video files from the new desktop folder onto a blank DVD, and then burning that DVD. However, in an average of about two out of every three attempts so far, my Mac rejects the new disk as unusable during the burn process.
    For the other original DVD - which has about 4.36GB on it - the contents of the new desktop folder won't fit onto a blank DVD. It then gets messy - shrinking the files - so I'd like to avoid all of that by getting DIsk Utility to work properly.

    For the answer, see the following excerpt from my own posting dated 2 May 2006, i.e.:
    "I finally found out for myself (from Disk Utility Help) that to make a new image from a file/folder, rather than dragging the folder to the Disk Utility pane, in the top menu bar in Disk Utility you select Images/New/Image from Folder."

  • How can I add new images to a saved book in Lightroom 4? Help please!

    As the title suggests, I have created a saved book in LR4. I saved it not because I had finished but because I wanted to protect my work to date. Now I cannot add new images, although I can work with (move and remove) the exisintg images in the book.
    I'm new to LR and can't help but feel that I'm missing something obvious. Any advice would be greatly appreciated!
    Thanks
    Graham

    Graham, switch to Grid view and drag the new photos to the book collection, which you'll find in the Collections panel.  Then flip back to the Book module and you'll find the photos sat there in the Filmstrip waiting to be added to the book design.

  • Canceled making a new image in Disk Utility, lost hard drive space

    Hi,
    I was creating a new image (12 gigs) and during the process of creating it, the bar was no longer moving (for over an hour) so i canceled the process (it got a about 1/4 of the way through). But now it seems I missing about 3 gigs of space on my hard drive. It seems when it got canceled, it didnt remove it all the way. Is there a way to fix this?
    Thanks

    I restarted the computer, and it did not change. I ran all the terminal commands on that website, but nothing fishy came up. After i ran the disk usage command (sudo du -cxhd 1 /) it totalled up to 51 gigs of data. I have an 80 gig HD (79.68gigs) which should leave 29 gigs available. Finder says i have 24.17 gigs available, so I am missing some. maybe this is virtual memory being used? It seems like it happened after the image though. Thanks

  • Photo gallery able to reorganise into subcategories + adding new images via in-browser editing

    Hi,
    I'm looking for a photo gallery which has the ability to reorganise the images displayed based on subcategories or tags. For example I want to add a gallery which contains photos of a clients projects. The client wants site visitors to be able to shuffle the gallery to view only for example "stone walls" or "timber decking". A tagging system would be handy rather than having to load the photos into each subcategory.
    The other consideration is that my client needs to be able to add new images with tags using the in-browser via Business Catalyst. So far I have only succeeded in replacing existing images rather than adding new images.
    Is there such a widget for Muse or are there anyother widgets for wordp-ress or other which could be embedded to tdo the job.
    Thanks in advance,
    Jimmy

    Hi Jimmy
    If I am not wrong, basically you want to provide users an option to select category of images which they want to show up on page.
    From Muse we cannot tag or categorize them , also photogallery module in BC does not provides this option, but there is a workaround with web apps.
    You can create a web app and then web app items as images and then categorize them. On page insert the web app with categories drop down, so when users will select the category those web app items would be displayed on page. Additionally you can add custom fields in web app to search using keyword.
    With editing , clients can login to BC admin and then using photogallery module or web app module ( if used ) to edit the images, add new ones. IBE cannot be used to add new ones but to replace existing ones.
    Helpful Links :
    http://helpx.adobe.com/business-catalyst/partner/web-apps.html
    http://helpx.adobe.com/business-catalyst/partner/building-web-apps-part-1.html
    Thanks,
    Sanjit

  • Can't add new image field in SRM MDM catalog

    Dear Experts
    I have added a new lookup[image] field in Catalog Item table.
    The problem is I cant find it in my
    MDM_SRM_UI_App>Customize Display tab>SRM-MDM Repository fields list
    Can't we add custom fields to repository?
    I also read this SAP Note 1028343 (Changes in repository not reflected in Catalog UI)
    where it is said to restart the mdm connector for the changes to take place.
    However the note is quite old. Is it still applicable?
    Please share your ideas.
    Thank you.
    Regards
    SwarnaDeepika

    Hi SwarnaDeepika
    There is already Images and PDF lookup available for each record in Catalog items table. I am not sure how we can create a new images lookup
    The below links explain the transport configuration process, this may help you identify custom fields in SRM-MDM Repository Fields list
    https://wiki.sdn.sap.com/wiki/display/SAPMDM/OpenCatalogInterfaceinSRMMDMCatalog+2.0
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/7246
    Regards
    Goutham Kanithi

  • New Image Deployment and Customization

    Administration needs to deploy thousands of new images to new workstations.  Existing workstations being replaced contain customizations that should be transferred to the new images without modifying the fundamentals of the new images.  In addition,
    both the existing and new images employ full disk encryption.  Any suggestions or resources that might reduce effort would be most welcome.
    Marty G.

    Hi,
    To migrate User profile data, app and profile settings, I would like to suggest you use User State Migration Tool (USMT) do finish this job.
    Here is some material about USMT may be helpful:
    User State Migration Tool (USMT) Technical Reference:
    http://technet.microsoft.com/en-us/library/hh825256.aspx
    Example:
    Using USMT V.5 to Migrate your Profile Data, Apps & Profile Settings:
    http://blogs.technet.com/b/nepapfe/archive/2013/04/15/using-usmt-v-5-to-migrate-your-profile-data-apps-amp-profile-settings.aspx
    If you need any further help about this problem, please feel free let us know.
    Roger Lu
    TechNet Community Support

  • Why is the size of new image constructed using Bufferd Image class less?

    I am trying to compress image losslessly, for start I what I am doing is:
    step1. Access pixels of .jpg image and store in array
    Step2. Reconstruct the image from same array
    What I have found is, that the size of new image constructed is less than the original.
    I am pasting the code below
    public static void main(String[] args) {
    BufferedImage sourceImage = null;
    try {
    sourceImage = ImageIO.read(new File("Sample.jpg"));
    } catch (IOException e) {
    int type = sourceImage.getType();
    int w = sourceImage.getWidth();
    int h = sourceImage.getHeight();
    byte[] pixels = null;
    if (type == BufferedImage.TYPE_3BYTE_BGR) {
    System.out.println("type.3byte.bgr");
    pixels = (byte[]) sourceImage.getData().getDataElements(0, 0, w, h, null);
    try {
    BufferedImage edgesImage = new BufferedImage(w, h, BufferedImage.TYPE_3BYTE_BGR);
    edgesImage.getWritableTile(0, 0).setDataElements(0, 0, w, h, pixels);
    ImageIO.write(edgesImage, "jpg", new File("result.jpg"));
    } catch (IOException e) {
    Please could any one explain me why is it so?

    I am working on a IEEE paper where in I am supposed to achieve a better compression ratios as compared to current JPEG standards. So if only loading and displaying the image results in size reduction and quality too, how do I go ahead with my algorithmI suggest you:
    (a) start with images in an uncompressed format such as TIFF, rather than a format which is already lossy (JPEG)
    (b) acquire some basic knowledge about JPEG before you attempt to improve on it, and
    (c) learn to quote accurately. Otherwise your paper will be refereed out of existence. I didn't say anything about 'loading and displaying the image resulting in size reduction and quality too'. I said 'loading and storing'; and 'change the contents', not 'size reduction and quality too'.
    A JPEG load and store operation does not result in a bitwise identical file. Frankly you should already know that.

Maybe you are looking for