• Post Reply Bookmark Topic Watch Topic
  • New Topic

Copying JPEG from one file to another?  RSS feed

 
Brian Snyder
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Can someone kindly point me in the correct direction? I need to copy a JPEG from one file folder to another. It seems so basic, but yet, I can't get it going.
Thanks in advance!!
Brian
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First you click on the 'My Computer' icon up in the corner of your screen, open up the folder the JPEG file is stored in, and then drag the file.... Oh, wait... you mean in Java...



HTH,
-Nate
 
Brian Snyder
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Nate!!!
That did the trick.
I like your joke....it was quite amusing.
Regards,
Brian
 
Brian Snyder
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nate or whomever else.....
I am now able to successfully copy a JPEG file from one filefolder to another....BUT......
The only problem is that it is SLOW!!! I put the code used to copy the file into a thread figuring it shouldn't take away from CPU time, but I still find that the program must wait until the copying is done before the user can do something else.
Any ideas on increasing speed??? Many thanks in adbance.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is faster. I had the same problem. This should fix it. Replace your code with:


------------------
Happy Coding,
Gregg Bolinger
 
Brian Snyder
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Gregg..
That did make a big difference. There's still some delay, but not as much as before. Good tip. I hope to return the favor.
Brian
 
Brian Snyder
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm back looking for another answer. I have 225 JPEG's that need to be copied. Using the above code takes about 5 MINUTES or more to do the job. When using My Computer in Windows it takes less than 1 minute.
There has to be an easier way.
I have used
That is quick. The only problem is that the old file obviously
gets removed. How do I 'copy' and not just 'cut and paste' my JPEGS?
Many thanks in advance!
 
gautham kasinath
Ranch Hand
Posts: 583
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Well have you tried to read the file by a kb??
Read instead of one byte each time the loop executes.. try reading a KB.. 1024 bytes..
that helps in speed coz it helped me on my winnt 4.0 ws
Regds
Gautham Kasinath
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you show a code sample of that? Sounds like a dandy idea.

------------------
Happy Coding,
Gregg Bolinger
 
Brian Snyder
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gautham,
Thanks for your reply. Does copying more than one byte at a time lose picture quality? Could you send me some code as well with your example so I can try it out?
Many thanks in advance.
snydb@home.com
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!