Feeds:
Posts
Comments

Archive for the ‘Graphics’ Category

If you’ve upgraded to Ubuntu 13.04, you may have noticed that its file manager, Nautilus, has lost some of its functionality. One of the glaring omissions in the 3.6x versions (the current is 3.6.3) is the Open With sub-menu when right-clicking a selected folder. Previously, you could use it to open a folder with a program, like Movie Player (now called Videos, though technically it’s totem) to open a folder full of video clips, or a folder full of pictures with Image Viewer (or eogEye Of Gnome – to be precise).

In this guide I’ll show you how to do both, but you can of course apply this to any program you want, as long as it has the ability to open a folder starting with the first file. In the case of Image Viewer, it will open the first file within the folder and continue to cycle through the rest as you use your arrow keys; in the case of Videos, it will open the media player with all videos from the selected folder in its playlist, in alphanumerical order.

To get around the missing Open With option, you will first need to install Nautilus Actions. To do so, run the following command in the terminal:

sudo apt-get install nautilus-actions

Once installed, you can use the Nautilus-Actions Configuration Tool to define your own actions (in Unity’s Dash menu, just start typing the name; in Gnome Classic, it will be in Applications > System Tools).

New Menu Item for Image Viewer:

In the Nautilus-Actions Configuration Tool, click the Define a new action button and name that action to what you want to appear in the menu (eg: Open with Image Viewer; whatever name you choose will also appear in the Context label: field in the first tab in the right-pane, Action).

Nautilus-Actions: Adding Image Viewer to Context Menu

Making sure that the new action is selected in the left-pane, in the right-pane go to the second tab – Command – where you define what that menu option will do. For the Path: enter eog (or the full path /usr/bin/eog), for Parameters: enter %b (for first basename), and finally for Working directory: enter %d (for first base directory). While there are a bunch of other tabs in the tool, that is all you should need to do.

Nautilus-Actions: Adding Image Viewer to Context Menu Step 2

If you want to add an icon for that menu option, you will see Icon: in the Action tab, where you can browse for an icon to use.

Nautilus-Actions Icon Chooser

Once you’re finished, click the Save button, and exit the tool. You will find your new action in the Nautilus-Actions actions sub-menu in your context menus.

Nautilus-Actions: Adding Image Viewer to Context Menu (DONE!)

(OPTIONAL: If you also want this action to appear in context menus for locations – in other words, not just the selected folder, but when you right-click an empty area of the folder you’re currently in – check the box next to Display item in location context menu in the Action tab)

New Menu Item for Movie Player (Videos):

In the Nautilus-Actions Configuration Tool, click the Define a new action button and name that action to what you want to appear in the menu (eg: Open with Movie Player or Play Movies in Folder; whatever name you choose will also appear in the Context label: field in the first tab in the right-pane, Action).

Nautilus-Actions: Adding Movie Player/Videos to Context Menu

Making sure that the new action is selected in the left-pane, in the right-pane go to the second tab – Command – where you define what that menu option will do. For the Path: enter totem (or the full path /usr/bin/totem), for Parameters: enter %b (for first basename), and finally for Working directory: enter %d (for first base directory). While there are a bunch of other tabs in the tool, that is all you should need to do.

Nautilus-Actions: Adding Movie Player/Videos to Context Menu Step 2

If you want to add an icon for that menu option, you will see Icon: in the Action tab, where you can browse for an icon to use.

Nautilus-Actions Icon Chooser

Once you’re finished, click the Save button, and exit the tool. You will find your new action in the Nautilus-Actions actions sub-menu in your context menus.

Nautilus-Actions: Adding Movie Player/Videos to Context Menu (DONE!)

(OPTIONAL: If you also want this action to appear in context menus for locations – in other words, not just the selected folder, but when you right-click an empty area of the folder you’re currently in – check the box next to Display item in location context menu in the Action tab).

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

PDF (Portable Document Format) documents are a handy way to present text and images to others knowing they’ll look the same no matter what word processor or operating system they use. Basically, they’re a snapshot of a document, so saving images from them can be a hassle, even if your viewer lets you right-click them and save them as files. There are a few programs around that can do this for you, but it’s actually much easier and faster doing this from the command-line.

The pdfimages command is part of poppler-utils, which should already be installed on your system (sudo apt-get install poppler-utils in the terminal if it isn’t). To extract the images from a PDF, just open a terminal in the folder with the document, and run a command like the following:

pdfimages -j Cool-Pix-of-2011.pdf cool2011

Note that when extracting from files with spaces in the name, you will need to enclose the filename in single quotes. Eg:

pdfimages -j 'Cool Pix of 2011.pdf' cool2011

The text at the end of the command is what each extracted image will begin with, so the resulting filenames will be cool2011-000.jpg onwards (note that numbering starts at 000, not 001). Once again, if you’d prefer to have spaces in the target names, for example to mirror the name of the original PDF, then enclose that in single quotes too (eg: 'Cool Pix of 2011 ' – note the space at the end, just to provide a bit more separation between '2011' and the hyphen preceding the automatic numbering; this is of course optional, and you can pretty much do what you want). Eg:

pdfimages -j 'Cool Pix of 2011.pdf' 'Cool Pix of 2011 '

Your pictures will now be extracted into the folder with names starting with Cool Pix of 2011 -000.jpg.

Also, the -j option is to save the images in the .jpg format, otherwise they will be saved in .ppm (Portable Pixmap) format, with each file being over a megabyte. This can mean, for example, that an 18Mb document with 120 images can extract to 154Mb of files, whereas exporting them as .jpg ends up with a total of 18Mb, just like the original document. Of course, if you’d prefer to save them as .ppm images, simply leave out the -j option.

If you would like to include the page numbering in the file names, add the -p option. Eg:

pdfimages -j -p 'Cool Pix of 2011.pdf' 'Cool Pix of 2011 '

Lastly, don’t worry if you see the following in the terminal for each image being extracted:

Error (18468081): Missing ‘endstream’
Error: Unknown operator ‘endstream’
Error: Unknown operator ‘endobj’

You shouldn’t see that with every PDF you try to extract from, but even when you do you should find the target images have been created without issue.

Extra Notes:

For more options for this command, run pdfimages -?. For example, you can specify a start and end page, but personally I find it easier to just extract the whole document and delete any images I don’t want afterwards. But if you need to specify a password, you will find the option here.

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

If you’ve ever installed any Windows programs in Ubuntu, you’d know Wine takes care of extracting the program’s icon (usually in the ancient .ico format) for use in Ubuntu. But, for whatever reason it may be, you may need to recreate those, but you don’t have the reinstall your programs just to do so.

In my case, copying over the entire .wine folder to a freshly-installed system gave me all my old Windows programs in perfect working order (gotta love Linux!), but the launchers no longer have the familiar icons. While I copied over a hidden folder with panel launchers, I’d have to do some digging in my old system to restore those icons to what they were, but probably a less time-consuming answer would be to just extract those icons, have them converted to .png, and put them somewhere safe for use with the associated program.

Another scenario for why you would want to extract icons is that the default icon for one of your programs is horridly pixellated, yet you know the .exe actually contains a bunch of higher resolution icons, and wish to change it to one of those, simply to make it look better.

Now, there are a bunch of apps available for this, mostly command-line solutions but a few little GUI apps as well, but the easiest to use is gExtractWinIcons. All you have to do is open a resource file (like an executable .exe or .dll library), pick a destination to save to, select the desired icon(s) for extraction, and click Save.

If the file contains a lot of images, click Deselect All, and manually mark those you want for extraction. Once you’re finished, move your icons somewhere safe, and assign them to your Wine programs’ launchers.

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

Nautilus Image Converter is a plugin or extension for Ubuntu‘s file manager that lets you quickly and easily resize and rotate image files. Once installed, all you have to do is right-click a picture file, or a group of them, and choose either “Resize Images…” or “Rotate Images…“.

In the Resize Images dialogue you can choose from predefined sizes via “Select a size:” (96×96 & 128×128 for thumbnails or avatars, as well as wallpaper dimensions for older 4:3 screen resolutions 640×480, 800×600, 1024×768 & 1280×960), “Scale:” it to a certain percentage, or choose your own “Custom size:“.

You will note that for “Append” the default is to save these altered images as copies with .resized added to the file name. You can choose “Resize in place” instead, but note that this overwrites the original, so use with caution.

With the Rotate Images dialogue, you can choose from 3 predefined angles via “Select an angle:“, being 90° clockwise, 90° counter-clockwise and 180°. If you need a bit more precision than that, just define your own angle with “Custom angle:“.

Like the resizer, the default behaviour is to save the output as a copy, this time with .rotated appended to the file name, though you can choose “Rotate in place” to overwrite the original.

This handy little plugin is installed very easily via Synaptic, but even quicker is to enter the following into a terminal:

sudo apt-get install nautilus-image-converter
The image converter options will be available in the context menu after a reboot, or you can log out and back in again if you want the changes to take effect immediately.

°ºÒθÓº°

Click here for more Nautilus Extensions!

Guide to Customising & Enhancing Nautilus

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

Please note that this is for the “legacy” version of GRUB still widely in use, not the next-generation GRUB 2. If unsure, check out this guide on how to find out which version of GRUB you are using.

↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔

You can create your own splash images for the GRUB bootloader menu, but they need to be 640×480 pixels in size, a maximum of only 14 colours, saved in the .xpm format, and then compressed. Sound too hard? Well, here’s a single command that does it all for you in one go!

In this example, the image is called “Ubuntu-Glass.png” and residing in the user’s Pictures folder. Obviously, just replace the path and filename in the example command with that of your own image. Another thing to remember is that some pictures resized will look very different (ie: distorted), so go for ones that have the same shape/ratios (in other words, wallpapers that are 800×600, 1024×768, 1600×1200, etc).

To convert a picture, enter the following (with correct filename) into a terminal:

convert -resize 640×480 -colors 14 ~/Pictures/Ubuntu-Glass.png ~/Pictures/Ubuntu-Glass.xpm && gzip ~/Pictures/Ubuntu-Glass.xpm

You now have a boot menu splash you can get GRUB to load instead of just showing white text on black background. Don’t know how to go about that? Then read about how to add a splash image to GRUB.

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »