Storing images and icons in a JAR file

Hi,
I current have a JAR file to store our application icons in the GIF format. The application also uses several images which I would prefer to be stored in the JAR file as JPG files.
Is it possible to store both GIFs and JPGs in a JAR and access them from Forms?
For Example:
I am using code like:
read_image_file('mess_bold.jpg','URL','IM_BOLD');
and I have this image file in the JAR but I get the error...
Unable to load image mess_bold.jpg for Image Item
Also the Apache log shows...
File does not exist: c:/oracle/frhome_1/forms/java/icons/mess_bold.jpg.gif
Is this a config problem? I noticed that the read_image_file call looks in the icons directory which I specify in my Registry.dat file. Do the settings for default.icons.iconpath and default.icons.iconextension apply to images as well?
Thank you in anticipation.
Regards,
Tom Casserly

Hi,
I already had the entry imageBase=codebase in my formsweb.cfg
According to this article it is possible to read images from the JAR using the 'URL' parameter see
https://metalink.oracle.com/metalink/plsql/f?p=130:14:2109110130595761322::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,137397.1,1,1,1,helvetica
I have managed to get the images loading from the JAR but only if I have them in the same directory and format (ie gif) as the icons. As I suggested above I think that read_image_file must be accessing the default.icons.iconpath=icons/ default.icons.iconextension=gif from my Registry.dat file.
There is also a slight problem that you cannot seem to use read_image_file in the WNFI or PF trigger as suggested here: Re: Read images from a jar file?
Has anyone managed to access images from a JAR in JPEG format alongside GIF icons?
Thanks for you help.
Regards,
Tom Casserly

Similar Messages

  • How do I display Canvas Graphic image (Not Iconic button) from jar file

    Hi all,
    I am currently using Forms 10g.
    I have gone through the tutorials on how to add Button Icons into Jar files for web enables forms .....so far so good
    This however does not explain what I actually want to do... since "graphic images are by nature embeded in the for rather than referenced ......so here goes ..
    I have a forms 10g application where all the individual form modules/canvases display a big banner (covering top 20% of the screen). This was done by importing the image straight unto the content canvases. As you know this now becomes a "graphic Image" now embeded(& not referenced by file name) on the canvas. Also bear in mind that this is actually different from an "Image Item" which is a block object.
    I dont know if this is possible, but what steps do i follow to make the image part of a jar file as opposed to my current situation. Please let me know if possible or not so I stop waisting development time looking for answers :)
    Another question is how do i make this jar file a library object so that we can vary the image as we wish
    NB: one other trick which i can think of is to create a giant push button across the screen to display the image and then stick it in a jar file !
    Cheers
    css_jay99

    I don't know about embedded images imported in from the builder, but there is a way to use READ_IMAGE_FILE into a BLOCK.IMAGE_ITEM where the images are all in a jar file stored on the OAS.
    Metalink Note:137397.1 explains it in details.
    Tony

  • How to include images/icons for a jar file

    Hi,
    I need to create a jar file which will contain my application. My source code (.java) files are in "app" folder. I compiled that using javac -d . *.java and one package("appl") was created. I have all icons and images related to my application are in the folder named "icons" in the directory where source files are located i.e; app folder - "app/icons". I am accessing the images in the icons directory as "icons/book.gif".
    I created a jar file from source file directory with the option
    jar cvf app.jar app
    and i added this jar file to my classpath also.
    I have created a batch file to execute this application and set that batch file to "path" environment variable.
    It is running from any directory but no icons are appearing in that application if i try to run the application out side the "app" folder.
    Can any body give suggessions to solve this problem?

    Thanks for the added info, now let's get started.
    To use files in jars, you need to refer to them via a URL, so you'll need to modify your code a little bit first.
    URL imgURL = ClassLoader.getSystemResource("icons/BOOK.gif");
    setIconImage(Toolkit.getDefaultToolkit().getImage(imgURL));Next, you'll need a manifest. Using any text editor such as notepad, create a file called manifest.txt and put two lines in it. The first line will specify the class (w/o .class on the end) that contains your public static void main method, the second line is just an empty line (just press return).
    Main-Class: main
    (a blank line)
    Save this file with your class files (e.g. in Exam folder).
    Next build your jar. We want the jar to contain the package folder and your icon folder as well. So use this:
    jar cmf Exam/manifest.txt myJar.jar Exam/*.class icons
    And you should now have an executable jar. You can run it from dos with:
    java -jar myJar.jar
    or you can double-click it from windows.
    -Ron

  • Browse files and dirs in the JAR-file

    Hi! I'm stuck with a problem concerning browsing a JAR file to find all images, fonts and sound clips. I think this is a pretty straight-forward task, except when I consider that the file I want to browse, is the same file the browser is stored in and running from. I have searched for hours on the internet now, and I still haven't figured out a way to be able to browse my JAR file.
    Here is the code I use when I'm not running my project in a JAR-file:
         * Load and cache all files (*.ttf, *.png and *.wav) from the resource-directory
        public void loadResources() throws FileNotFoundException {
            // log available VRAM
            log.println("Available VRAM before loading resources: " + graphicsDevice.getAvailableAcceleratedMemory() + " bytes", Log.INIT);
            // determine whether or not we are dealing with the contents of a jar-file
            jar = getClass().getResource("").getProtocol().startsWith("jar");
            // browse all directories
            long start, end;
            int loadTime = -1;
            start = System.nanoTime();
            browseDirectory(".." + separator + "resources");
            end = System.nanoTime();
            loadTime = Math.abs((int)(end - start) / 1000000);
            resourcesLoaded = true;
            // log
            log.println("Resources loaded in " + loadTime + " ms", Log.INIT);
            // log available VRAM
            log.println("Available VRAM after loading resources: " + graphicsDevice.getAvailableAcceleratedMemory() + " bytes", Log.INIT);
         * Browse a directory and load and cache all it's files
         * @param path The directory to browse
        private void browseDirectory(String path) {
            // log
            log.println("Browsing directory: " + path.replaceFirst("\\W*", ""), Log.INIT);
            try {
                if (jar) {
                    // TODO: enable JAR-browsing by getting the input stream from the JAR-file, then browse through all entries
                    throw new RuntimeException("Cannot browse JAR-files yet!");
                else {
                    File dir = new File(getClass().getResource(path).toURI());
                    // browse through the directory
                    String[] files = dir.list();
                    File file;
                    for (String name: files) {
                        file = new File(dir.getAbsolutePath() + separator + name);
                        // if this is a new sub-directory, browse it
                        if (file.isDirectory()) browseDirectory(path + separator + file.getName());
                        // otherwise, add the file
                        else addFile(path, name);
            catch (Exception e) { e.printStackTrace(); }
        } But, as you may see, I need a similar code to browse the JAR-file....please help me!
    lhk

    I worked it out by trying and failing:
          * Browse the JAR-file and load all it's relevant files
         private void browseJar() {
              try {
                   // convert the resource directory path to a JAR-compatible path
                   String jarDir = dir.replaceAll("\\" + separator, String.valueOf(jarSeparator));
                   // get the jar-file and it's entries
                   Enumeration<JarEntry> entries = new JarFile(new File(getClass().getProtectionDomain().getCodeSource().getLocation().toURI())).entries();
                   // browse the contents of the file
                   JarEntry entry;
                   int nameIndex;
                   String name = null;
                   String path = null;
                   while (entries.hasMoreElements()) {
                        // get the entry
                        entry = entries.nextElement();
                        // we only process relevant entries
                        if (entry.getName().startsWith(jarDir)) {
                             nameIndex = entry.getName().lastIndexOf(jarSeparator);
                             name = entry.getName().substring(nameIndex + 1);
                             // if we find a new directory, we get it's path
                             if (entry.isDirectory()) {
                                  path = entry.getName().substring(jarDir.length(), nameIndex);
                                  if (path.startsWith(String.valueOf(jarSeparator))) path = path.substring(1) + jarSeparator;
                                  // log (the system-compatible path)
                                  log.println("Browsing directory: " + dir + separator + path.replaceAll(String.valueOf(jarSeparator), "\\" + separator), Log.INIT);
                             // otherwise, we add the resource
                             else addFile(path, name);
              catch (Exception e) { e.printStackTrace(); }
         }As may be seen in the code, I discovered that the regular file separator could not be used in jar paths, which I found strange. I tried a lot to make the regular separator work, but couldn't manage it. Anyway, this code works for me.

  • How do I read the images I bundled into the jar file?

    I just wrote an applet that uses
         Toolkit tk = Toolkit.getDefaultToolkit();
         tk.getImage("blah.gif");to load a bunch of image files. The class file and gif images were bundled into a jar file to minimize the number of connections the browser has to make to the server.
    The applet works fine in appletviewer but trips a java.security.AccessControlException: access denied (java.io.FilePermission select.gif read) when run in a browser. I know you normally use Applet.getImage(URL) to load images but wont that circumvent the JAR file and make a seperate connection to the server for each image? That would defeat the purpose of using a JAR file.
    How do I access the image files I bundled into the JAR file?

    From your Applet class, write the following:
    URL imgUrl = getClass().getResource("blah.gif");
    Image img = getImage(imgUrl);The returned URL will be from the Applet class ClassLoader, which will look into the specified archive (jar) file.

  • Not getting com.ibm.mq.jar and com.ibm.mqjms.jar files

    Hi Sudhir,
    Thank you very much for your guidance.
    But I am not getting com.ibm.mq.jar, and com.ibm.mqjms.jar files. what do I have to do to get this file?
    And do I require both these files in getting initial context for JNDI.
    Thanks in advance.
    Have a nice day

    Hay,
    theres also a zip file from IBM titled MA88 that contain the jar files needed for supporting JMS programs in a Java env (these files are included there) and they're also included in WBI v5.2 and higher.

  • How to change the icon of the jar file w/o changing the windows setting

    I may be in wrong forum/area but I am not sure.
    I have created a windows executable jar file. Functionally it works fine. I can double click it to start my app. I want to change the icon of the jar file. I know I can change the icon for .jar extension in windows, but I want to be able to give a seperate icon for just this one file.
    All windows applications have thier own icon like Word, Excel etc. Is there any way I can do this for java apps? Also could this icon be kept consistent across platform say if I copy my app to linux? (Assuming it is not made for any particular os.)
    I am sure someone has come across this before.
    Thanks in advance.

    AFAIK you cannot specify an icon for a jar file. You can, however, specify an icon for a Frame using the setIconImage() method. This will have the effect of showing the icon in the taskbar for instance.

  • Deploying Images and Iconic buttons in forms 6i

    Deploying Images and Iconic buttons in forms 6I.
    This feature I am trying to use in Oracle Applications 11i.
    My environment is on HP Unix both database and web server.

    Hellow, i too have problems , to show icons in push buttons, in the browser, maybe you know how to migrate the toolbar to web.
    thanks you
    null

  • IconService and classpath in executable jar file

    I use JDIC project (https://jdic.dev.java.net/) and want to use its incubator project iconService as well - both of them in one project. When I run my program from within Eclipse 3.1 IDE, everything works.
    But if I export it to a jar file, the program does not run. I found out that Eclipse 3.1does not create the manifest file correclty. When using only JDIC, I wrote this line to the Manifest file and the exported jar worked:
    Class-Path: external_libs/jdic-0.9-bin-cross-platform/jdic.jarBut when I try to add also the other library - Iconservice to the classpath of the Manifest file like this:
    Class-Path: external_libs/jdic-0.9-bin-cross-platform/jdic.jar external_libs/Icon_service/jdic_icon.jar the console writes out these errors:
    Exception in thread "main" java.lang.ExceptionInInitializerError
    at Frontend.Mainframe.getIcon
    Caused by: org.jdesktop.jdic.spi.ProviderException: Provider org.jdesktop.jdic.icons.impl.WinIconProvider  can not be found
    at ...
    I suppose that the program cannot find the needed "jdic_icon.dll" but I do not know how to set the path to a dll into classpath of manifest file.
    Can anyone help me?
    Thanx in advance.
    Lubos.

    [This is a cross-post of http://forum.java.sun.com/thread.jsp?forum=424&thread=453226]

  • Just downloaded CC 2014 trial. I cannot select any images and it's ruining the files

    Just downloaded CC 2014 trial. I cannot select any images and it's ruining the files

    Before reloading, I would try deleting the preferences. It may not help in this case, but it is worth a try.
    In case you need help with that:
    Reset Preferences
    1) Close the program and press Ctrl+Alt+Shift/Cmd+Option+Shift during startup (not reversible)
    or
    2) Move the Folder. See:
    http://www.bugge.com/Family-and-friends/Illy/illy.html
    --OB

  • How can i use adobe drive/cs4 for storing images and interact this with adobe cq5.4 DAM...

    Hi,
    Can anybody suggest me i want use adobe drive to store images and i want to access the images for my cq5.4 instance..
    I want to integrate drive to the cq5.4 dam for ignoring the dam burden on cq5 instane repository..
    Is it possible to use this drive? or is there any other way i can achieve my task?
    Thanks,
    Sony C.

    Adobe Drive software doesn't store images; it enables integration of a DAM system with Creative Suite and now Creative Cloud desktop apps.
    Adobe Drive 3 is the first version of the software to support integration with Adobe's DAM. This version was designed to work with CS5 and CS5.5 apps.
    We do not have a version of Drive that supports integration with CQ 5.4 DAM and CS4 apps.

  • Just purchased Nikon D610. tried to import 3 images and got this message: The files are not recognized by the raw format support in Lightroom. How do I fix this frustrating problem. Have been using Lightroom for years also Nikon products without any prior

    How do I import images. Have a message that says: The files are not recognized by the raw format suppot in Lightroom. Am using a Mac version 10.9.4. the import is from a new Nikon D610. Am using LR 4.4 Please help Adobe is useless as a support.

    Each camera must be supported explicity and your LR version is years older than your camera.
    According to Adobe's Camera-support page, you need at least LR 5.3 to work with your D610 NEFs in LR:
    Camera Raw plug-in | Supported cameras
    If you don't want to upgrade to LR 5, or can't due to your OS being too old, then it might work to use the latest DNG Converter and create DNGs from your NEFs, which should open in LR 4.x.  You can find the DNG Converter here:  http://www.adobe.com/downloads/updates

  • Read barcode or QR code inside image and save it in the file as metadata

    Maybe someone can help me with this question...
    All product photos contain a barcode or QR-code. It is visible inside the image.
    The customer is looking for a way (a plug-in) that is able to find the code inside the image, read it and place the information found in a preselected Metadata field of the image it self.
    Can anyone tell me if this already exists or is there anyone who can develop it? If yes, than please let me know
    Regards,
    Pieter

    It would be absolutely incredibly useful to me as a volume photographer, and I suspect other photographers too.  Anybody who needs to link data to images or catalogue images would be the target market.
    Let me outline a conversation that I had with a Lightroom developer at TTG recently, who unfortunately can't help me...
    Original Conversation is at:  Lightroom 6 (Page 1) — General — Community @ The Turning Gate (post 17 onwards).
    Automatically matching and syncing data to pictures is a huge software industry in its own right, believe me.
    As a school photographer (though not solely), matching student IDs to their pictures makes everything so much easier and is vital to update student record databases with images of pupils.  But it's also very relevant to other sectors such as events and sports photographers.  Imagine if this data could be incorporated into TTG database search facility.... (Do we have a swoon smiley?)
    Several pieces of commercial software is available, but most rely on the camera being permanently tethered to a laptop and using a barcode scanner to renames files as they come in.  This is a crap, restrictive system but is the one the vast majority of people use.  An example of this is the Australian Timestone software (http://timestonesoftware.com) which is very popular, but runs into the thousands of UK Pounds for a licence.
    An American photographer called Mike Fulton wrote a piece of software called fotovelocity.net which does exactly what I prefer - to photograph the pupil with a barcode somewhere in the image that later gets read by the software and data appended to the metadata of the image.  This is slightly cheaper than Timestone, but still runs into the thousands and he not interested in dealing with anybody outside the US.  
    If Lightroom can read and guess faces to add naming data, then it must surely be an easy upgrade to read an easily scannable QR code?
    and ...
    Has to be relevant to more than just me, surely?
    Imagine all the events / dance meets / clubs / nurseries / schools / football photographers that would use this.  Admittedly, this is all volume 'hot-dog' photography and not the artistic side, but it puts a fairly nice roof over my head.
    With schools I get a database beforehand, but for most events you don't need to know anything about the attendees to the event beforehand, as you just print out labels that have qr codes with sequenced numbers on them which the portrait subject (or their parents) then keep.  They then either visit a printing booth and type the code or take it home and type the code into their browsers and #kabam# up comes their images for purchase.  How they run it so that only the first image has the barcode visible yet all subsequent images retain the data from the first image until another barcode is detected I don't know.  I guess it must be that a numeric sequence must also be appended to the data from the barcode.
    It's a wonderful system for photographers, which is why it costs megabucks.
    I will admit though, that the commercial software tends to lab integrate as well, so there is more than just barcode reading.  Unfortunately, this ties you in to the system that your preferred lab uses, usually Timestone in the UK, and hence why people have to pay those silly license prices.
    If you need a sample image with a QR code in just let me know.
    Maybe fotoveolcity instructional videos may give you an impression of how this type of software flows and performs.
    General Volume Workflow ‹ Foto Velocity

  • Capture image and get info from flv file

    Hi everyone
    would apprichate help from any one who can tell me how and is
    their any batch software for win\linux that can prepare xml file
    with movie length and jpg\gif image capture of one of the frames
    (if i can set to to frame 20 and not 1 as dafualt) out of flv file.
    its for academic fms project and we have thousands of courses
    which we recorded and got them on flv, and need the data for the
    catalog.
    so - if any one can pls assist, got something ready or just
    tell me how to do it, we really will apprichate it.
    10x very much !

    FLVMDI will create the XML file for you (it will have
    additional nodes, but it will have the info you need). FFMPEG will
    extract the images for you.
    I'm not sure if either of those programs do batch
    runs.

  • Why is Keynote storing images 20x larger than the original file size upon import?

    In Keynote, I'll add a 150KB PNG image to a slide and the 500KB presentation goes to 3.7MB... a more than 3MB increase. I'm trying to troubleshoot large file sizes as a simple deck takes up 50-100MB on disk. Anyone know what is going on to make the file 20x larger once added to Keynote? And how I can keep the file size down? The 'Reduce File Size' option is worthless in this case... offering a less than 10% reduction on the earlier 20x amplification. Thanks

    Chris H 71 wrote:
    This was originally in Keynote 09.
    Yes converting an existing version 5 file in to Keynote 6 does many strange things. Any existing version 5 files I have, I continue to edit in 5. When starting a new presentation, I can use 6 without many problems at all.
    I provided the files to replicate the issue to Apple support and never heard back.
    Apple do not provide feedback to users on issues, they only request information from users.

Maybe you are looking for