Feeds:
Posts
Comments

Posts Tagged ‘images’

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!

Advertisements

Read Full Post »

Ever since Ubuntu 10.04 “Lucid Lynx”, there has been a white border around thumbnails of pictures and videos when you look in a folder. But you can actually change that to whatever you want, and here I’ll show you how to turn the distracting white border into a nice drop-shadow, free of any other border.

Open a terminal and enter the following:

wget http://a.imageshack.us/img135/8666/thumbnailframe.png

That will download the image file to your home folder; the following command will then move it to the folder where Nautilus (your file manager) keeps its image files, renaming it appropriately as it does so:

sudo mv thumbnailframe.png /usr/share/pixmaps/nautilus/thumbnail_frame.png

Now, you need to totally restart Nautilus:

sudo nautilus -q

If you decide that you want to restore the original white border, you can basically run the same sequence again, but this time downloading the familiar thumbnail background:

wget http://a.imageshack.us/img651/5790/thumbnailframey.png

sudo mv thumbnailframey.png /usr/share/pixmaps/nautilus/thumbnail_frame.png

nautilus -q

***************

Additional notes:

Obviously, you can play around with your own thumbnail borders using the dimensions of the drop-shadow image (quite simply a square).

Also, if you would prefer to copy rather than move the image files to the Nautilus folder, thereby always having copies in your home folder, replace mv (move) in the command with cp (copy).

***************

Just in case the images are no longer available, you can find them below. Simply right-click them and (1) in the case of the larger drop-shadow image, choose to save the target of the image (or open it in a new tab and save the image that appears), and (2) in the small default image below it, choose to save the image. If you saved them to your home folder, the second command in each sequence will still apply; if you saved them to another folder, like ~/Downloads, open a terminal in that folder and the commands will work fine.

Right-click & save the target (not this smaller image)

Right-click & save this image

***************

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

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 »

Unless you have a totally fresh install of Ubuntu, you have probably noticed that each time you boot up, the GRUB boot menu lists a bunch of previous Linux kernels which you can boot into. While this can occasionally come in handy – like if you can’t boot into the new kernel after an upgrade – those previous kernels, images and modules are usually just wasting space.

While you can go into Synaptic, search for all the bits and pieces of previous kernels, and mark them for removal, here is a much easier method. In a terminal, simply paste the following command, and it will remove all but the current kernel (if you’ve upgraded your system, or had an update with a new kernel, please reboot your machine before running this):

dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge

You will see some info about what is going on:

The following packages will be REMOVED:
linux-headers-2.6.35-22* linux-headers-2.6.35-22-generic*
linux-headers-2.6.35-23* linux-headers-2.6.35-23-generic*
linux-image-2.6.32-25-generic* linux-image-2.6.35-22-generic*
linux-image-2.6.35-23-generic*
0 upgraded, 0 newly installed, 7 to remove and 13 not upgraded.
After this operation, 586MB disk space will be freed.
(Reading database … 261863 files and directories currently installed.)
Removing linux-headers-2.6.35-22-generic …
Removing linux-headers-2.6.35-22 …
Removing linux-headers-2.6.35-23-generic …
Removing linux-headers-2.6.35-23 …
Removing linux-image-2.6.32-25-generic …

It will then go on to generate a new GRUB menu, and when you reboot, you’ll see only the current kernel is listed.

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

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: This article is for earlier versions of Nautilus File Manager (2.x) found in earlier Ubuntu releases running on  Gnome 2.x, so will not work in Unity (the default desktop environment) or Gnome Shell, both of which are based on Gnome 3.

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

Nautilus can be cosmetically customised quite easily, so it’s a simple matter to replace the blank window background with either a picture, colour or gradient, as well as make important files and folders stick out from the rest.

Simply go to Edit > Backgrounds and Emblems… and you can choose to change the background image (via Patterns), background colour (via Colours), as well as designate emblems to files and folders of your choosing (via Emblems).

To make a pattern or image the background for folder windows, simply drag-and-drop it onto an empty area of Nautilus, and it’s done. And if you want to revert to a blank background, drag the Reset option at the top instead of an image.

Similarly, if you just want a different colour as the background, in the Colours section you can drag a new background colour to Nautilus, and it will immediately change. Note that if you drop the colour in the corner or near the edge of the window, rather than closer to the centre, it will create a gradient of that colour blending into the previous one.

Assigning an emblem to a file or folder, for the purpose of making it stick out, is likewise a very simple matter. Once again, all you need to do is drag one of the emblems, then drop it onto the file or folder in question.

You might notice that there is no option for resetting an object to have no emblem, but all you have to do should you want to remove one is right-click the file or folder, choose Properties, go to the Emblems tab, and untick the emblem that is being used.

°ºÒθÓº°

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 »