Big sleep image file!?

I'm not sure if it's big but I'm running out of room on my hard drive about 7G left out of 100G. I figure I might be able to clean some of that clutter so I ran the Disk inventory utility.
It found that my sleep image is 13G, is it normal?
For info I rarely shut down my computer (may be once a month), actually my session right now as been up for 9 days.
Any advise, idea?
Thanks
Thierry
PS: As well as 7 swap files totaling another 5G approximately
Message was edited by: ThierryR

Why don't you just replace your drive with a much larger one? Check out MacSales.com for larger drives for your model.
With only 2 GBs of RAM I would not expect a 13 GB sleep image. The sleepimage file should be the size of the installed RAM.
You have a lot of swap space in use because you are running too many concurrent processes for the amount of RAM installed. Add more RAM or run fewer applications. Rebooting will also reduce the swap file to its default.

Similar Messages

  • Problem with loading big image files in 1.4

    Hi, I recently discovered that after updating my jdk from 1.3 to 1.4, my application seems to be failing to display image files over 300kbytes, or at least the display is corrupted.
    Originally I have a gif file over 300k (2048X512 pixels) and the display got corrupted, but when i reduced the file (1024X512) the display did not corrupt.
    Is there any way other than to cut the filesize of the image??
    ~Jeffrey

    I know that focus management has changed alot.
    Based on my experimentation a while back, in 1.4 it still believes that the JFrame is the window in focus, even though a JOptionPane is currently in front of it (unless I misinterpreted what was going on). Thus, the frame seems to get the keyboard event and re-invoke the action.
    A.F.

  • How to display a dynamic image file from url?

    Hey,I want to display a dynamic image file from url in applet.For example,a jpg file which from one video camera server,store one frame pictur for ever.My java file looks like here:
    //PlayJpg.java:
    import java.awt.*;
    import java.applet.*;
    import java.net.*;
    public class PlayJpg extends Applet implements Runnable {
    public static void main(String args[]) {
    Frame F=new Frame("My Applet/Application Window");
    F.setSize(480, 240);
    PlayJpg A = new PlayJpg();
    F.add(A);
    A.start(); // Web browser calls start() automatically
    // A.init(); - we skip calling it this time
    // because it contains only Applet specific tasks.
    F.setVisible(true);
    Thread count = null;
    String urlStr = null;
    int sleepTime = 0;
    Image image = null;
    // called only for an applet - unless called explicitely by an appliaction
    public void init() {
                   sleepTime = Integer.parseInt(getParameter("refreshTime"));
              urlStr = getParameter("jpgFile");
    // called only for an applet - unless called explicitely by an appliaction
    public void start() {
    count=(new Thread(this));
    count.start();
    // called only for applet when the browser leaves the web page
    public void stop() {
    count=null;
    public void paint(Graphics g) {
    try{
    URL location=new URL(urlStr);
    image = getToolkit().getImage(location);
    }catch (MalformedURLException mue) {
                   showStatus (mue.toString());
              }catch(Exception e){
              System.out.println("Sorry. System Caught Exception in paint().");
              System.out.println("e.getMessage():" + e.getMessage());
              System.out.println("e.toString():" + e.toString());
              System.out.println("e.printStackTrace():" );
              e.printStackTrace();
    if (image!=null) g.drawImage(image,1,1,320,240,this);
    // called each time the display needs to be repainted
    public void run() {
    while (count==Thread.currentThread()) {
    try {
    Thread.currentThread().sleep(sleepTime*1000);
    } catch(Exception e) {}
    repaint(); // forces update of the screen
    // end of PlayJpg.java
    My Html file looks like here:
    <html>
    <applet code="PlayJpg.class" width=320 height=240>
    <param name=jpgFile value="http://Localhost/playjpg/snapshot0.jpg">
    <param name=refreshTime value="1">
    </applet>
    </html>
    I only get the first frame picture for ever by my html.But the jpg file is dynamic.
    Why?
    Can you help me?
    Thanks.
    Joe

    Hi,
    Add this line inside your run() method, right before your call to repaint():
    if (image != null) {image.flush();}Hope this helps,
    Kurt.

  • How to delete a jar file after loading image files from it

    Hi,
    How can I delete a jar file after some image files have been loaded? For example, say, I have "a.jar" which contains an image "a.gif" in the root directory of the c drive. I would like to get the image size and then delete the jar file. Here is the code snippet:
        URL url = new URL("jar:file:/C:\\a.jar!/a.gif");
        Icon icon = new ImageIcon(url);
        System.out.println("icon size ? " + icon.getIconHeight());
        File file = new File("c:\\a.jar");
        while(file.exists())
            file.delete();
            try
                Thread.sleep(100);
            catch (InterruptedException ignored)
        System.out.println("file deleted.");I get the image size correctly but just can not delete the jar file. Apparently the file handle is not released, but how to close it? Any hint will be appreciated.
    Justin Jan

    I am sure the URLConnection.defaultUseCaches is set before it is connected otherwise I should catch an IllegalStateException on conn.setUseCaches(false).
            try
                URL url = new URL("jar:file:/C:\\a.jar!/a.gif");           
             URLConnection conn = url.openConnection();
               conn.setDefaultUseCaches(false);
             conn.setUseCaches(false);
                Icon icon = new ImageIcon(url);
                System.out.println("icon size ? " + icon.getIconHeight());
                url.openConnection().getInputStream().close();
                System.gc();
             System.runFinalization();
                File file = new File("c:\\a.jar");
                while (file.exists())
                    file.delete();
                    try
                        Thread.sleep(10);
                    catch (InterruptedException ignored)
                System.out.println("file deleted.");
            catch (Throwable t)
                t.printStackTrace();

  • Any way to get an image file's height?

    I am now trying to dynamically insert a Canvas component with
    an image component inside of it. I need to re-used the code for
    many images. Apparently it is only working if I give the canvas a
    width and height, which needs to be the size of the image file.
    How can I do this?

    Images are just display objects. You should be able to grab
    the measuredWidth and measuredHeight properties off of it to
    determine how big your canvas needs to be. If you're dynamically
    changing the source of your image, watch for the dataChange event
    that the image dispatches when its source changes.

  • Double-click and drag don't open image files

    Hi,
    I'm having problems loading images in Preview and Adobe apps (CS1).
    From Finder, I can double click to open an image in Preview but it only opens the first image, and won't load more than one. I've tried changing the preferences to "open groups of images in the same window" or "open all images in one window." Neither solve the problem.
    My adobe apps won't open a file when I double click it from the finder at all. I have to use the "open" command from within the application to open an image file.
    I am a designer and photographer trying to browse groups of images at once and this is driving me crazy! I have tried copying over different preference files from my old computer (a powerbook G4), and I'm wondering if I either failed to copy the right one or copied something that is interfering with the shortcut actions.
    The interesting part is, that the same actions are working fine for other kinds of files -- for example, I can open multiple word documents by double clicking their icons in Finder.
    Any suggestions appreciated. Thank you.
    Amy Hengst

    Hi Amy
    What kind of files are these? If I wanted to open multiple images in Preview (be they BMP, JPEG, PSD, whatever) I would select them and drag onto the Preview icon in the Dock which opens the first image in a single window with the remaining images in a 'thumbnail drawer' to the right (like you get with big PDF documents).
    On the other hand if I double-click, 10 to 1 it would launch Photoshop which I use as an image editor only, not an image manager or viewer. You can of course change the application which any document uses to open it, with the Get Info window. But if you use more than one application (as I do - PS to edit, Preview to just view), then click-and-drag onto the Dock might be your best bet.

  • Please add support for JPEG Exchangeable Image File Format (EXIF)

    It seems that now Adobe® Illustrator® can export only to the JPEG File Interchange Format (JFIF). We should have an option to produce the JPEG Exchangeable image file format (EXIF) as well (just like Photoshop does!). Why this is so important to me? I generally work under Illustrator and I often post my work on Behence. I work with 'sRGB IEC61966-2.1' color profile. When publishing I use *.jpg with embedded ICC Color Profile. But it looks like Behence doesn’t fully support the JPEG JFIF – for example it cannot read its icc data correctly. The effect is that my work looses its quality! The only option to produce the JPEG EXIF I have now is to: Export *.ai file to JPEG (under Adobe Illustrator) > go to Photoshop > Create new project > Paste the *.jpg > and Sava As JPEG with icc embedded. This guarantees my files are being processed correctly.
    (JPEG) Formally, the EXIF and JFIF standards are incompatible. This is because both specify that their particular application segment (APP0 for JFIF, APP1 for Exif) must be the first in the image file. In practice, many programs and digital cameras produce files with both application segments included. This will not affect the image decoding for most decoders, but poorly designed JFIF or Exif parsers may not recognize the file properly. ( http://en.wikipedia.org/wiki/JPEG_File_Interchange_Format#Exif_comparison )
    I’ve analyzed my files using JPEGsnoop 1.6.1 (an app by Calvin Hass, http://www.impulseadventure.com/photo/) and here is the result:
    A) an *.jpg file produced with Adobe Illustrator > File > Export > JPEG > ICC profile embedded:
    *** Marker: SOI (xFFD8) ***
    OFFSET: 0x00000000
    *** Marker: APP0 (xFFE0) ***
    OFFSET: 0x00000002
    length     = 16
    identifier = [JFIF]
    version    = [1.2]
    density    = 72 x 72 DPI (dots per inch)
    thumbnail  = 0 x 0
    B) an *.jpg file produced with Adobe Illustrator > File > Save For Web > JPEG > ICC profile embedded:
    *** Marker: SOI (xFFD8) ***
    OFFSET: 0x00000000
    *** Marker: APP0 (xFFE0) ***
    OFFSET: 0x00000002
    length     = 16
    identifier = [JFIF]
    version    = [1.2]
    density    = 100 x 100 (aspect ratio)
    thumbnail  = 0 x 0
    C) an *.jpg file produced with Adobe Photoshop > File > Save As > JPEG > ICC Profile embedded
    *** Marker: SOI (xFFD8) ***
    OFFSET: 0x00000000
    *** Marker: APP1 (xFFE1) ***
    OFFSET: 0x00000002
    length          = 1320
    Identifier      = [Exif]
    Identifier TIFF = 0x[4D4D002A 00000008]
    Endian          = Motorola (big)
    TAG Mark x002A  = 0x002A
    EXIF IFD0 @ Absolute 0x00000014
    Dir Length = 0x0007
    [Orientation ] = Row 0: top, Col 0: left
    [XResolution ] = 720000/10000
    [YResolution ] = 720000/10000
    [ResolutionUnit ] = Inch
    [Software ] = "Adobe Photoshop CC 2014 (Windows)"
    [DateTime ] = "2014:08:02 17:21:15"
    [ExifOffset ] = @ 0x00A8
    Offset to Next IFD = 0x000000D4
    EXIF IFD1 @ Absolute 0x000000E0
    Dir Length = 0x0006
    [Compression ] = JPEG
    [XResolution ] = 72/1
    [YResolution ] = 72/1
    [ResolutionUnit ] = Inch
    [JpegIFOffset ] = @ +0x0132 = @ 0x013E
    [JpegIFByteCount ] = 1006
    Offset to Next IFD = 0x00000000
    EXIF SubIFD @ Absolute 0x000000B4
    Dir Length = 0x0003
    [ColorSpace ] = sRGB
    [ExifImageWidth ] = 200
    [ExifImageHeight ] = 200
    Regards,
    Pawel Kuc

    This is a user-to-user forum and is not monitored by Apple for feedback purposes. You can give feedback to Apple here: Apple - Mac OS X - Feedback

  • Is it safe to back up a disk image file when it's mounted?

    Hi -
    I use some small, encrypted ".sparsebundle" disk image files to keep my diary, banking info, etc., on. When I'm at the computer, I keep them mounted all the time.
    Is it safe to let Time Machine automatically back up the .sparsebundle disk image files, even while they are mounted? Or would there be a possibility the backups would be corrupted, if the operating system hadn't written out cached data or something to the disk image file?
    In other words, if I save any open documents on the mounted disk image, does the disk image file on disk always contain the fully-saved document and a consistent file system? Or could there still be some data cached in RAM, that would not be saved at the time the .sparsebundle file was copied? Is it always necessary to unmount a disk image before duplicating its .sparsebundle file?
    Do I need to turn off Time Machine's automatic backup, and just do manual "backup now" after unmounting the disk images? That's a major pain in the behind... I really want to just let Time Machine do it's hourly backups as usual, but of course there's no point if the backups are corrupt.
    Of course my own guess is "to be safe", I should unmount them before backing up. But again it's a big pain if it's not actually necessary. Does anyone know for sure?
    Thanks...

    My understanding is that Unix, generally, doesn't write everything out to disk immediately. There is caching in RAM to speed up disk access, including modified superblocks, modified inodes, and delayed reads and writes. Now, if you ask to read an individual file, the kernel makes sure all the cached data is written before it returns the read data. But if you try to do, for example, a block copy of the whole filesystem, the kernel doesn't know that, and there's no guarantee or expectation that the filesystem will be in a coherent state.
    That's the purpose, for example, of the "sync" command - to write all this cached data to disk before unmounting, shutting down, etc., and, that's why the OS gets so upset if you just unplug a firewire drive. Because even if you've saved and closed any open documents, they haven't necessarily been fully written out to disk yet.
    So what I don't understand, is how people are ever able to back up mounted disk image files without them getting corrupted. I mean, you'd think they would get corrupted all the time. It would be the equivalent of just unplugging your firewire drive before you made a backup of it, or of doing a block copy of a read/write mounted filesystem. There ought to be a very good chance of the filesystem being scrambled. So, why does it not happen?
    Is there something different about the Apple filesystem, or Apple disk images? Or, maybe we're only talking about delay times in the cache of fractions of a second, so as long as you haven't written anything within a few seconds of the copy, and don't write anything during it, you're ok?
    Even if Apple reps won't answer my question, the kernel and most likely all the low-level disk i/o and filesystem stuff is open source. Surely there's someone out there who would be knowledgeable enough to give a definitive answer? I was hoping to find someone like that here... I do appreciate your taking the time to answer my post, but maybe I need to go elsewhere, on some developers' mailing lists or something? Does anyone know of such a place I could start looking?
    Thanks...

  • Why is image file size getting inflated by Pages?

    I have a newsletter I am creating, and I have inserted 6 photos. They have been pre-downsized using Image Ready, so each image is around 30k. But after they have been inserted, the file size of the entire Pages document is huge. So I opened the Package for the document (Control click on the icon) and I see that now the images are each around 300k. The images have not been manipulated in Pages, no shadows or strokes. They have been resized just a teeny bit (made smaller in all cases).
    So what is going on to cause this huge inflation of file size. It is making my document too big to email (although it has helped to control the pdf export to "Good"... or even better to use the Color Sync file size reduction dialog, which is buried so deep in the Print dialog that I can't believe this is a common way to do it...)
    Anyway, all help would be appreciated. Thanks, Peter

    yes, you are right that the best results that I got were from the Print command and the color sync option to reduce file size. Without that, I took a Pages doc that was around 2.7megs and the pdf varied from 1.8-2.5 using the export command. With the color sync method I did get it down to a 450k pdf, which I am satisfied with.
    Still it baffles me that a 40k jpeg will inflate to 300k in Pages. I don't see multiple copies in the Package for the document, so I don't think it is multiplying. And I think that at least one of the images lives in the document without having been resized from within Pages, so that doesn't seem to be involved.
    I am using jpegs, adjusting them in Photoshop and then optimizing them with Image Ready, but they are JPEGs all thru the process, and they clearly are averaging around 35-40k after Image Ready does it's t hing. That is the whole purpose of Image Ready, it comes with Photoshop with that intention solely. I could try saving the image file in Preview or some other program and seeing if it inflates liek the Image REady jpegs do.
    Anyway, I am still curiouis about why this happens, but I can live with the rather bizarre method of using the Print>Color Sych method.
    Thanks to all of you for your help, really,
    Peter

  • Unusual Bug when creating pdf from image files

    Hi I have a very mindboggling problem which I cant seem to get my head around.
    basically I am trying to create a pdf using a large amount of image files, these images are scans of pages of a book. so I have been trying to create a pdf file from these images, and everytime i try, it all looks ok except for one page which comes up smaller in size than the rest which is a big problem and very unusual. If I change the view of acrobat so that it shows two pages at a time then this is clearly visable where one page is normal and the page next to it is like a third of the size. Ive checked the image file properties for that page and they are more or less the same as the rest, the dimensions of the image file too, but when I add it into a PDF it seems to shrink in size, any ideas as to why? any help would be much appreciated! (and I hope what I said made sense lol )
    Thanks
    Nav

    Hi Davew000
    Can you please tell the steps you are doing to create the PDF ?
    Thanks,
    Tanvi

  • Image files created by CS6 not viewable in iOS devices

    Hello,
    This is kind of a strange one.
    I'll start off with what I am running:
    My computer - Late 2013 MacBook Pro (Retina) running Yosemite (10.10.1)
    My Photoshop - CS6 (13.0.6 x64)
    And now the issues:
    I am not able to view any emailed image files, on any of my iOS devices (using the default mail app) that were created by CS6 on my laptop.
    As a test, I had someone in my office create a .jpg using their Photoshop, had them email it to me, and I was able to view it on my iPhone using the default mail app.
    So, something in particular with my installed version of CS6 is doing something strange when outputting files that are making them not viewable by the default iOS mail app.
    I work in film, and often have to email images to clients (which many of them are using iPhones), so having the images not viewable is a big issue for me.
    Has anyone experience anything like this, or perhaps know what may be causing this?
    Thanks so much for your input,
    Greg

    This has somewhat been resolved.  This is actually an Outlook issue, Outlook is doing something strange to the image file when emailing that is causing the problem.
    Ugh, sorry for the post. 

  • Incredibly strange file size discrepancy only appears in image files (jpg, gif, png)!

    I'm creating a bunch of banners for google ads, yahoo ads, ...etc in Photoshop on my Mac OS!
    The .gif files of these banners appear to TRIPLE in size when on the MAC (>150KB), but when transferred to windows; the real file size shows correctly! (<50KB)
    It is not a result of the base2 vs base10 discrepancy since the difference in size is simply too big, and it only happens with files created on Photoshop on my Mac.
    The reason I know that windows is showing the correct size while my Mac OS is displaying the wrong size, is that the file gets approved by google and yahoo ads, even though Mac OS shows that it surpasses the size limit (50KB) three times over!
    This isn't an isolated incident either, all image files created in Photoshop on the MAC continue this weird behaviour! However, files downloaded from the net appear to be consistent on both operating systems!
    One example is the attached screenshot:
    Explanation, please??

    Geez, sorry I offended you Mr. Jobs (incarnate)!
    You came in here with a three ton chip on your shoulders. Did you really expect sunshine and puppies in return?
    No, I expected useful help, and I got it from Jeffrey Jones. Thanks again Jeffrey!
    I mean, when you move or upload it, it loses this data association anyways!
    To a drive which doesn't support Apple's AB tree structure (NTFS, FAT, FAT32, exFAT), yes. To another HFS+ drive, no.
    What about uploading the file to the cloud?? Does it lose this association or not?? And does anyone really care about the data in the Resource fork?
    This "Resource Fork" means nothing to the file owner, only to the OS and the Drive. Therefore, it shouldn't be added to the total. Period. Because its not part of the file, its part of Apple's tree structure! This is really a simple concept, not sure why you are bending over backwords to defend a clearly stupid oversight from apple!
    There's no reason to force me to use the command line to get the real file size of a GIF! There's just no excuse for that!
    If an OS is saying it is fetching file size information for a single file, it should do exactly that! Not add hidden Resource Forks that are part of the OS's internal workings
    OS X is fetching the file size. It's file size, not the way a different OS would report it.
    There is no such thing as it's file size. A file size is a file size, accross all platforms, on the cloud, wherever!
    A GIF file should have the same file size whether its on windows, linux, unix, darwin, freeBSD, or anything else. The only time its weight should vary is in outer space!
    That is why I'm surprised that they are breaking simple UI Design rules.
    The User Interface has nothing to do with the file structure of a drive.
    I don't care about the structure of the drive!! Neither should you, neither should the average user!
    A good UI should NOT concern the user with this! The average user doesn't care about these Resource Forks, and will never try to view them, therefore, there is no logical reason to add up their file sizes to the total size of each file, and then to make things worse, hide that fact! That only creates confusion, and it makes it so much harder for a designer like myself to view the REAL file sizes of my image files! Now, whenever I'm on my MAC, I will have to run command line scripts to be able to see if my GIF files (that I work on EVERYDAY) meet the file size quota, because Mac OS adds up hidden files that I have no use for and gives me the WRONG file size!
    Let's say this again: when you select a file and click get info, you should get the info for the file you selcted. Nothing more, nothing less! I don't care if the file structure creates an entire colony of hidden files, they should be completely hidden to me, and if not, the Get Info dialog box should at least give me two sizes, one is the REAL file size, and the other is the added up file size for the Resource Fork as well (although I can't think of any good reason why it should add up the Resource Fork size anyways)!
    do you think it is at all logical, that when you select 300 or so files, and click Get Info, that it open 300 windows at once each showing separate information for each file? Or does it make a lot more sense, intuitively, to get the total tally of all the files selected added up, without having to hold down shortcut keys when clicking them to do so?
    Yes, it is logical because that's what you, the user, told the OS to do. You wanted the Get Info data on 300 individual items. I don't know about you, but I avoid the menu bar as much as possible (your reference to avoiding shortcut keys). Command+I will always give you singular Get Info dialogue boxes.
    No, that's not what I told the OS to do. I selected 300 files cumulatively, therefore, I should get the cumulative info for all the selected files. That's just common sense. Every other OS seems to get this!
    And I'm hard pressed to find anyone who has found a use for having 300 get info boxes open at the same time. Therefore, that shouldn't be the default.
    Will you start defending apple's decision to stick with the one button mouse for all these years depriving us from the all important context menu as well?? There was absolutely no good reason to do that, just as there is absolutely no good reason to do this!

  • IWeb site update problem-app missing images/files, but site is ok

    I created and uploaded a web site to my .mac (yeah, MobileMe) and it displays just fine. I have visited it from a couple of different comps. The problem is that I want to add/update files/pages, but when I open iWeb, several of the images/audio files do not display: shows a x-through and a centered question mark. They are in the sites idisk folder and in the laptop's copy of the files. When I try to replace the missing images/files by dragging onto the iWeb drafting page the following message appears: "the file can't be used because you don't have access privileges, or because it contains no content or was corrupted."
    I'm afraid to make any updates for fear of losing what is already published.
    Extra info: have family pack and am switching between .mac accounts because iWeb published to the iDisk corresponding to the account/sub-account you are logged into (BIG pain in the ***! It should have a password protected account toggle like Panther used). I have double-checked that the files for this site are only in the one iDisk account (am redirecting my masked domain url to the .mac iDisk server-works great.
    Any ideas?

    The upgrade from '06 to '08 which changed the domain.sites to a domain.sites2 caused more confusion, disasters and lost web sites than the bug ridden introduction of '09.
    I ended up rebuilding all my sites from new, blank domain files in '08 and the conversion to '09 went OK apart from '09's nasty habit of changing media file links.
    Fortunately, I have very little QuickTime content and don't use the iWeb Photos, Albums Blog or Podcast templates.
    Most iWeb built sites look pretty awful when users stick to the default page width. I start from a Blank, Black or white page and trash everything on it.
    I use the "standard" 980 px page width and most, if not all, of the iWeb themes do not adapt to this.
    This is why I constantly ask the question. "Do the iWeb developers actually build any websites with the application?".
    Perhaps if they did, we would get more bug free releases and some of the features that "real life" users are requesting.

  • Using thread to read a big number of files

    Hi all,
    I got a question with THREAD. Can you help me, please?
    I have a class, PragFileLoader, to read many files in a folder. First readDir() reads whole directory and gets a list of file name. Then readFile() reads each file. And finally readLine() reads each line in a file. The problem here is a big number of files. So I have to construct many instances of PragFileLoader. However I should use some kind of lock in a file, which is read by certain PragFileLoader, to let other instances of PragFileLoader know that it's locked therefore these instances won't read the locked file, they gonna to read other files.
    import java.io.*;
    import java.util.Vector;
    public class PragFileLoader extends Thread{
        private Vector v;
         * Constructor
        public PragFileLoader() {
            v = new Vector();
         * Read a line
         * @param str a line to read
        public TrafficDataObject readLine(String fN, String str) {
            // Do something
        public synchronized void readFile(String fileName, File in, File err, File done) {
            try {
                Thread.sleep((int) (Math.random() * 100));
                  // Do something           
            } catch (IOException e) {
                e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
            } catch (InterruptedException e) {
                e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
            notifyAll();
        public void readDir() {
            //   Vector v = new Vector();
            File in = new File(Preferences.PRAGINBOX);
            File err = new File(Preferences.PRAGERROR);
            err.mkdirs();
            File done = new File(Preferences.PRAGDONE);
            done.mkdirs();
            String[] fileName = in.list();
            for (int i = 0; i < fileName.length; i++) {
                //readFile(fileName, v, in, err, done);
    readFile(fileName[i], in, err, done);
    public Vector getV(){
    return v;
    public void run() {
    for (int i = 0; i < 10; i++) {
    readDir();
    try {
    Thread.sleep((int) (Math.random() * 100));
    } catch (InterruptedException e) {
    And in main() I construct 10 instances of PragFileLoader and I got nothing

    Do you have to make readDir() part of PragFileLoader?
    Why don't you first read the directory once, and then assign the files to a thread each. I don't think it's efficient to have too many file reading threads running at the same time.

  • How to convert EPS(image file) file in to other image format e.g NIGMAS

    Hi friends,
    I want to make a tool which will help to convert the EPS image file into other image format BY USING JAVA TECHNOLOGY. I havent done this type of file conversion before, so any body please explain it to me from the basic how can i go for it, what r the require things, where should i get the help of it, which java API should i use etc. i ll be vry thankful.
    My actual requirement is i want to convert the EPS file into the NIGMAS(Nihon computer graphic mapping System) file format.
    Thank you in anticiption.

    The easiest, but not necesarily the best, way is to use ImageMagick's convert utility. From Java you can use Runtime.exec to invoke convert.exe ... ImageMagick is opensource and supports many different formats ( www.ImageMagick.com )
         * Converts an eps file to a graphic that is suitable for the web.
         * We use ImageMagick's 'convert' utility to convert .eps files into either gif or png format.
         * The output format is determine by the extension that you set for the output file.
         * Sample command:
         * convert -density 208x208 /export/home/kpmg/tomcattest/jsp/1.eps
         *                                    /export/home/kpmg/tomcattest/jsp/1.png
         * Although convert supports about 100 different parameters, we are only using 1:
         * -density     (sets the vertical and horizontal resolution in pixels of the image)
         * Density sets the vertical and horizontal resolution in pixels of the image.
         * It should be changed based on the resolution of the user's monitor
         * (e.g. if hi-res display settings, then density will need to be greater
         * than if running on a low-res display, which would make the same image look really big )
         * You may want to use other convert parameters, such as -sharpen
         * to make the image look better, or -compress and
         * -quality to change the kb size of the image.
         * For the full list of parameters see:     
         *      http://www.imagemagick.org/www/convert.html
         * @param inFile The absolute path to the eps file to be converted
         * @param outFile The absolute path to the desired output graphic file.
         *                         NOTE: the format of the output file is determined by the
         *                         extension that you give for this parameter (e.g. file.png will
         *                          be written as a png file )
    public void eps2www(String inFile, String outFile, String density) throws Exception
              // use ImageMagick's convert program to make the www version ( png or gif, etc)
              String call = convert +
                        " -density " + density +
                                  " " + inFile +
                                  " " + outFile;
              try
                   Process child = rt.exec( call );
                   child.waitFor();
                   log.debug("Convert process exit code is: " + child.exitValue() );
              catch (Exception e)
                   // TO DO: this could probably be more explicit
                   throw new Exception(e);     
              // log the command strings for debuggin purposes.
              log.debug( "Convert Successful: call = " + call);
         }

Maybe you are looking for