Results 1 to 18 of 18

Thread: Ubuntu experts needed!

  1. #1
    Play me a Newfie jig! markusman64ds's Avatar
    Join Date
    Jan 2012
    Location
    Newfoundland
    Posts
    719
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default Ubuntu experts needed!

    Not sure where to put this thread, but it's kind of a technical issue, just not hardware.

    A little while ago I made a lot of scans with XSane on Ubuntu. I noticed that whenever you saved a file it would say .jpg or .png at the end (not just on the properties menu). This never happened in Windows Explorer, where it would just show the photo name and not the extension (I only recently changed to Ubuntu), so I proceeded to remove the extensions from the photo names. The photos are still viewable, as Ubuntu knows they are JPEGs, but whenever I try to upload the files to a website, the websites can't tell that they are images.

    So I need to find a way to fix this. If there was some program that let you change the file extensions of hundreds of images all at once, that would be cool. I just don't know of any programs like this. Hopefully I don't have to go into each filename and change the extension, cause you know, hundreds of files.

  2. #2
    Strawberry (Level 2) Custom rank graphic
    FoxNtd's Avatar
    Join Date
    Mar 2010
    Location
    USA/米国
    Posts
    570
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    4
    Thanked in
    4 Posts

    Default

    Quote Originally Posted by markusman64ds View Post
    I noticed that whenever you saved a file it would say .jpg or .png at the end (not just on the properties menu). This never happened in Windows Explorer, where it would just show the photo name and not the extension (I only recently changed to Ubuntu), so I proceeded to remove the extensions from the photo names. The photos are still viewable, as Ubuntu knows they are JPEGs, but whenever I try to upload the files to a website, the websites can't tell that they are images.
    Windows Explorer's default behavior is to "hide extensions for known file types" which can, of course, be disabled. *nix type OSes such as Linux don't depend on extensions to determine filetype unlike stupid Windows as they actually read the header of the file to determine what kind of data is really there. You can use the "file" command on the command line to see detailed output about a file's type since the header is truly being read. Why did I say stupid Windows? Because it's one of the oldest security risks/tricks in the book. Change the extension of a file to something else and Windows will believe that file is what the extension says it is. They were too lazy with MIME types and never corrected this issue all these years.

    Extensions in Linux are for human-reading convenience. The system really doesn't care. Ever notice that executable binaries do not ever have extensions? They can, it just doesn't mean anything.

    Quote Originally Posted by markusman64ds View Post
    So I need to find a way to fix this. If there was some program that let you change the file extensions of hundreds of images all at once, that would be cool. I just don't know of any programs like this. Hopefully I don't have to go into each filename and change the extension, cause you know, hundreds of files.
    Use the command line.

    EDIT: OK if you're asking the question you probably don't know how to do it. Suppose you have a set of files in a directory that need to have ".jpg" appended to them. Pretty simple to do with this:

    Code:
    for i in `ls *`; do mv $i $i.jpg; done
    You might want to replace ls * with something else if you really don't want to do this to every file in that directory. That was an example.
    Last edited by FoxNtd; 06-05-2012 at 06:57 PM.

  3. #3
    Pac-Man (Level 10) FABombjoy's Avatar
    Join Date
    Jul 2002
    Location
    Lansing, MI
    Posts
    2,145
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    Open the command prompt
    Change to the directory with the files
    Assuming that you're using bash by default, do this:

    for file in ./* ; do mv ${file} ${file}.jpg; done

    If you're not using bash, just type "bash" before the above command.

    Everything in that directory will get a .jpg extension. If you have mixed PNG and JPG, you may want a fancier solution.
    Console5.com - Console parts, kits, games and more. [shop] [wiki] [RSS] [f] [t]

  4. #4
    Play me a Newfie jig! markusman64ds's Avatar
    Join Date
    Jan 2012
    Location
    Newfoundland
    Posts
    719
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    Quote Originally Posted by FABombjoy View Post
    Open the command prompt
    Change to the directory with the files
    Assuming that you're using bash by default, do this:

    for file in ./* ; do mv ${file} ${file}.jpg; done

    If you're not using bash, just type "bash" before the above command.

    Everything in that directory will get a .jpg extension. If you have mixed PNG and JPG, you may want a fancier solution.
    By command prompt do you mean terminal? And I'm not sure how to switch directories in terminal. Command lines ain't my thing.

  5. #5
    Play me a Newfie jig! markusman64ds's Avatar
    Join Date
    Jan 2012
    Location
    Newfoundland
    Posts
    719
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    Ok I got it working, but it only changed the filenames with one word in the title.

  6. #6
    Strawberry (Level 2) Custom rank graphic
    FoxNtd's Avatar
    Join Date
    Mar 2010
    Location
    USA/米国
    Posts
    570
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    4
    Thanked in
    4 Posts

    Default

    Quote Originally Posted by markusman64ds View Post
    Ok I got it working, but it only changed the filenames with one word in the title.
    Probably need double-quotes around ${file} so it properly recognizes files that contain spaces. e.g.:

    Code:
    mv "${file}" "${file}.jpg"

  7. #7
    Pac-Man (Level 10) FABombjoy's Avatar
    Join Date
    Jul 2002
    Location
    Lansing, MI
    Posts
    2,145
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    Quote Originally Posted by FoxNtd View Post
    Probably need double-quotes around ${file} so it properly recognizes files that contain spaces. e.g.:

    Code:
    mv "${file}" "${file}.jpg"
    Ah, I always forget space handling.
    Console5.com - Console parts, kits, games and more. [shop] [wiki] [RSS] [f] [t]

  8. #8
    Play me a Newfie jig! markusman64ds's Avatar
    Join Date
    Jan 2012
    Location
    Newfoundland
    Posts
    719
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    That worked, but the ones that already had them (the ones with one word) now have two. Ex. Asteroids.jpg.jpg

  9. #9
    Strawberry (Level 2) Custom rank graphic
    FoxNtd's Avatar
    Join Date
    Mar 2010
    Location
    USA/米国
    Posts
    570
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    4
    Thanked in
    4 Posts

    Default

    Quote Originally Posted by markusman64ds View Post
    That worked, but the ones that already had them (the ones with one word) now have two. Ex. Asteroids.jpg.jpg
    Having fun yet?

    Code:
    rename .jpg.jpg .jpg *.jpg.jpg

  10. #10
    Play me a Newfie jig! markusman64ds's Avatar
    Join Date
    Jan 2012
    Location
    Newfoundland
    Posts
    719
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    Got it working, thank you all.

  11. #11
    Play me a Newfie jig! markusman64ds's Avatar
    Join Date
    Jan 2012
    Location
    Newfoundland
    Posts
    719
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    Having problems instaling Java. I downloaded the Linux version from their website, but I can't figure out how to install it.

  12. #12
    Strawberry (Level 2) Custom rank graphic
    FoxNtd's Avatar
    Join Date
    Mar 2010
    Location
    USA/米国
    Posts
    570
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    4
    Thanked in
    4 Posts

    Default

    Quote Originally Posted by markusman64ds View Post
    Having problems instaling Java. I downloaded the Linux version from their website, but I can't figure out how to install it.
    Any reason why something like this doesn't work?

    Code:
    sudo apt-get install sun-java6-jdk
    In any case not only does the Ubuntu community have a forum and support chat on IRC but there are many resources out there where you can quickly find the answer to this. I don't mind helping but the DP forum isn't your best place to seek out help.

    Oh, and choose the right package. Maybe you just want the JRE (Java Runtime Environment) instead of the entire SDK (Software Development Kit).

  13. #13
    Play me a Newfie jig! markusman64ds's Avatar
    Join Date
    Jan 2012
    Location
    Newfoundland
    Posts
    719
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    Quote Originally Posted by FoxNtd View Post
    Any reason why something like this doesn't work?

    Code:
    sudo apt-get install sun-java6-jdk
    In any case not only does the Ubuntu community have a forum and support chat on IRC but there are many resources out there where you can quickly find the answer to this. I don't mind helping but the DP forum isn't your best place to seek out help.

    Oh, and choose the right package. Maybe you just want the JRE (Java Runtime Environment) instead of the entire SDK (Software Development Kit).
    I typed that into the terminal, and got this:

    markusman64ds@markusman64ds-Aspire-5551:~$ sudo apt-get install sun-java6-jdk
    [sudo] password for markusman64ds:
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Package sun-java6-jdk is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Package 'sun-java6-jdk' has no installation candidate
    markusman64ds@markusman64ds-Aspire-5551:~$

    Maybe this is the code for an older version. Also I don't really feel like joining another forum if I'll only go on it a few times. Any more suggestions?

  14. #14
    Strawberry (Level 2) Custom rank graphic
    FoxNtd's Avatar
    Join Date
    Mar 2010
    Location
    USA/米国
    Posts
    570
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    4
    Thanked in
    4 Posts

    Default

    Quote Originally Posted by markusman64ds View Post
    Maybe this is the code for an older version. Also I don't really feel like joining another forum if I'll only go on it a few times. Any more suggestions?
    You don't have to join. You just need to look. There's probably 5 copies of every commonly asked question already on there. Also I checked where their IRC channel is.

    Server: irc.freenode.net
    Channel: #ubuntu

    Go to the package manager (Synaptic?) and find XChat. It's a nice IRC client. While you're there, look up Java. I don't see why Java wouldn't be listed there.

    The package name I mentioned previously is for a slightly older version of Ubuntu so it doesn't surprise me the package name is outdated. You still didn't say if you need the JDK or JRE. I suspect you're not going to be programming Java so the JRE is what you want. Maybe this is the recent package?

    Code:
    sudo apt-get install oracle-java7-installer

  15. #15
    Play me a Newfie jig! markusman64ds's Avatar
    Join Date
    Jan 2012
    Location
    Newfoundland
    Posts
    719
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    Quote Originally Posted by FoxNtd View Post
    You don't have to join. You just need to look. There's probably 5 copies of every commonly asked question already on there. Also I checked where their IRC channel is.

    Server: irc.freenode.net
    Channel: #ubuntu

    Go to the package manager (Synaptic?) and find XChat. It's a nice IRC client. While you're there, look up Java. I don't see why Java wouldn't be listed there.

    The package name I mentioned previously is for a slightly older version of Ubuntu so it doesn't surprise me the package name is outdated. You still didn't say if you need the JDK or JRE. I suspect you're not going to be programming Java so the JRE is what you want. Maybe this is the recent package?

    Code:
    sudo apt-get install oracle-java7-installer
    E: Unable to locate package oracle-java7-installer

    Also, I just want the JRE. Gotta play some Minecraft.

  16. #16
    Strawberry (Level 2) Custom rank graphic
    FoxNtd's Avatar
    Join Date
    Mar 2010
    Location
    USA/米国
    Posts
    570
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    4
    Thanked in
    4 Posts

  17. #17
    Play me a Newfie jig! markusman64ds's Avatar
    Join Date
    Jan 2012
    Location
    Newfoundland
    Posts
    719
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    Quote Originally Posted by FoxNtd View Post
    That worked. Thank you!

  18. #18
    Play me a Newfie jig! markusman64ds's Avatar
    Join Date
    Jan 2012
    Location
    Newfoundland
    Posts
    719
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default One last problem

    I think this is a known issue, but I can't play Minecraft demo mode. I downloaded the launcher, and when I click "Play Demo" it says it is updating, but it never does. Still in Ubuntu. Any ideas? Internet searching isn't showing much.

Similar Threads

  1. 350 Action Figures....experts needed
    By DreamTR in forum Buying and Selling
    Replies: 9
    Last Post: 09-07-2010, 10:13 PM
  2. Amiga experts: pricing help needed
    By y-bot in forum Classic Gaming
    Replies: 2
    Last Post: 06-08-2006, 05:32 PM
  3. Help from Nintendo experts needed
    By devilman in forum Classic Gaming
    Replies: 24
    Last Post: 05-25-2006, 04:08 PM
  4. Atari 2600 Rarity Help - Experts Needed!
    By Cmosfm in forum Classic Gaming
    Replies: 7
    Last Post: 12-10-2003, 05:17 PM
  5. Super Nintendo Shooters.... help needed from you experts!
    By Atari7800 in forum Classic Gaming
    Replies: 13
    Last Post: 07-29-2003, 08:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •