Programming :: Print Images From Command Line At A Specific Size

Jan 7, 2010

I have a requirement to print images (two to be precise) from the command line of a given size and without losing too much quality.

So, I may have two images, a.jpg and b.jpg which may be 4x4" and 6x4" respectively (the sizes may vary). I need to be able to print both these on a single sheet of paper (one under the other) at a given size for each - so a may be 2x2" and b may be 3x2" - the aspect ratio will always be maintained (or as near as possible!)

I am currently doing this a very messy way (because I don't know any other way!!) - basically I am converting the picture to a given size using a set density using convert and then concatenating the two using montage.

Here is part of my script:

Code:

Don't worry too much about the case statement at the end - that is just to be able to select to print either A, B or A and B.

The issue with this is that is doesn't work great if the aspect ratio is not maintained perfectly and also, it loses quite a lot of quality on the print.

I have a very old windows app which I wrote years back in VB (o dear! ) which does the same thing and the quality is fine (I am running it through wine). I want it to be command line though because I want to run it as part of other scripts etc.

View 4 Replies


ADVERTISEMENT

Programming :: Using An Awk Command To Print A Line From A Cvs File?

Mar 4, 2011

I am using an awk command to print a line from a cvs file.the awk command includes an if statement that filter the output-lets say i want to print all the lines that the price field is greater than 30.i have it working when i put the parameters myself.. but when i try to send them with vars it wont work..i am sending the sign of the if statement - can only be: == , < , >it looks like this:

cat file.csv | awk -v sign=">" -v field="2000" '{if($3 sign field) printf "%-12s%-12s%-12s%-12s
",$1,$2,$3,$4}' FS=,

the bold part is the problem , because when i put the sign parameter myself t works great.. i guess its a chars issue but i cant spot it

View 3 Replies View Related

Software :: Resize Images To Specific Size Correctly

Feb 4, 2010

I need to find a program that will allow me to take images 600 x 600 and resize down to fit a specific size like 95 x 139. I need the images to not distort. There is white space around the objects in the images. I also need to be able to crop on a pixel scale to know that I am resizing it correctly.

View 3 Replies View Related

Programming :: Copy And Replacing Specific Line From File1 To File2 Line By Line

Mar 22, 2011

I have two files, file1.traj and file2.traj. Both these files contain identical data and the data are arranged in same format in them. The first line of both files is a comment.

At line 7843 of both files there is a cartesian coordinate X, Y and Z ( three digits ). And at line 15685 there is another three digits. The number of lines in between two cartesian coordinates are 7841. And there are few hundreds of thousands of lines in a file.

What I need to do is copy the X Y Z coordinate (three digits) from file1.traj at line 7843 and paste into file2.traj at the same line number as in file1.traj. The next line will be 15685 from file1.traj and replace at line 15685 at file2.traj. And I dont want other lines (data) in file2.traj get altered. This sequence shall be going on until the end of the file. Means copy and substitude the selected lines from file1.traj into file2.traj.

I tried to use paste command but I cant do for specified line alone.

Here i showed the data format in the file. I used the line number for clarity purpose.

Code:

View 10 Replies View Related

Programming :: Pthread - Take String From The Command Line And Creates A Thread To Print The String

May 3, 2011

I've been trying to understand pthread in C a little better. So I made a simple program that takes in a string from the command line and creates a thread to print the string. I've looked online and copied the basic concepts but there are something things I'm confused about. The programs works just fine, but I have questions. Here's what I have so far.

[Code]....

One thing I'd like to know is why the 3rd argument in the pthread_create function which is my SendMessage function needs to be typecasted to a void pointer and then send the address of the function. Also as for the 4th argument, I would see typecasting to void pointer in some of the pthread examples I saw online, but in my case I'm passing a char pointer, would this be correct? In which case would I ever want to pass a void pointer?

Do I need a pthread_exit(NULL) in my main and in the SendMessage function? If so, why? I added the sleep() function so that I could let the pthread_exit function in my SendMessage function execute first. I simply saw that the online examples on pthread had pthread_exit() in both locations.

View 6 Replies View Related

Programming :: Replace Specific Character After Specific Line By Awk?

Jul 19, 2010

I want to replace specific character in a file after every specific line. example as follows.

O 000000000000000000
A 111111111111111111
C 222222222222222222

[code]...

View 2 Replies View Related

Programming :: Compare Two Files Line By Line And Print The Line Which Is Same?

May 30, 2011

I am trying to write a program in C which compares two files and prints the line that is equal.

Here file1.txt has

and file2.txt has

Note: file2.txt consist of only a single string where as file2.txt has multiple lines. Actually im comparing two files with md5sum values.

Here is the code but it compares only first line of files..but it should compare the whole file1..and sorry iam a beginner in C can any1 sujest some modification to this code so that..it can compare file2 with entire file1

Quote:

View 9 Replies View Related

Programming :: Scripting To Find Line And Print Previous Line To Out

May 21, 2010

I have a perl/python interpreter available on the system so really as long as the script would run on a standard linux build I'll be happy.So I don't know how to program a script that would find the unique key (which if needed, can be easily stripped out and put into a separate file) and then print out the data below it without going into the other lines.

View 4 Replies View Related

Programming :: Text On A Specific Line At The End Of A Line?

Jul 26, 2010

I'm trying to add text to a file for a specific group of users, I'll need to do examples as I can't think of an easy way of explaining, my file is like this:

Code:

users{
user1
user2

[code]....

At the present my code lists all the available groups, how would I add a user to a specified group? (e.g add "members user3") to the end of group 1 for example. So the code ends up like this

Code:

members user2,user3

View 14 Replies View Related

Programming :: Parse HTML And Print Specific Table?

May 13, 2009

I'm trying to write a script that will spider a particular webpage that shows the current inventory for their products. I need to figure out the optimal method of parsing the web page, and extracting the <td> line for the "qty" for "Product 2":

Code:

<table border="0" width="100%" cellspacing="1" cellpadding="3">
<tr>
<td align="left" style="background-color: #EAEAFF; border-bottom-style: solid; border-bottom-width: 1" nowrap width="20%" height="50">
<p align="left"><font face="Arial" size="2"><b> Evaluation

[code[.....

View 4 Replies View Related

Software :: Command Line Tools To Convert HTML To Images Without A GUI?

Mar 13, 2009

I've spent a lot of time googling on this one, but could not really find anything that would convert HTML to images. Does anyone know if there are some command line tools that can do this? I need to convert simple HTML documents to images to be attached to Powerpoint presentations. Could firefox gecko be tapped into to do this without a GUI?

View 4 Replies View Related

Programming :: PHP Booleans - Print Draw The First Image From A Function Then Hide The Rest Of The Images Using 'display: None'

Jul 29, 2010

I have this function that is supposed to print draw the first image from a function then hide the rest of the images using 'display: none' however for some reason the boolean test does not seem to work on one of my servers however it works on another, is there some php.ini setting I am missing or can you see any issues with the following code:

[Code]....

View 1 Replies View Related

Ubuntu :: Print To PDF From Command Line

Jul 11, 2011

I am trying to find a way to print PDFs from the command line. I was using "cups-pdf', but I want to be able to specify the output folder from the command line. Is there a way to do this? I guess what I am trying to do is the Gnome "Print to file" option in the terminal so I can easily print off a batch of file to whatever directory I wanted.

View 4 Replies View Related

Ubuntu :: Use Multiple Cut Command To Print Output On A Line?

Apr 27, 2010

how to use multiple linux cut comman to display on same line ?

e.g ls -il | cut -f6 d:
ls - il cut -f9 -d:

The linux script output is

filename
123

How to use cut to display on same line ?

View 1 Replies View Related

CentOS 5 :: Printer In GUI Can Print Fine From The Command Line

Oct 6, 2009

I work at The University of Alabama as a sysadmin on various HPC resources and also provide support for faculty using Unix systems. I've run into one problem that is affecting two different desktop systems running CentOS 5.3.oth of these systems have the latest updates. These machines have standard network-attached printers. One is an HP LaserJet 3250 and the other is a model that is pretty close to that one.Previously these users were able to print from graphical applications such as Firefox, but now when the print dialog is opened on ANY graphical application, it causes a hard freeze on that particular app.Printing from the commandline via `lpr` gives no issues and test pages from the Printer Admin interface also succeed.This problem has me stumped, so I'm looking for any insight as to what could have changed. I do not know what changed between the time when the printers worked graphically and when they stopped, but the users assure that they have changed no settings. The only thing I can suspect is a rogue update since this is affecting separate users on separate machines with separate printers.

View 4 Replies View Related

General :: Tail Command Syntax To Print A Sequence Of Line ?

Dec 21, 2010

How to print a sequence of line say line number 10 to 20 of a 50 line file ?

View 6 Replies View Related

Programming :: Sed Append To End Of A Specific Line?

Jan 29, 2011

What I am trying to achive is the editing of /etc/ssh/sshd_config I have the line

Code: AllowUsers usera userb

And I want to be able to append to the end of this line from a bash script.I have muddled together from other sites and got the following:-

Code: sed -e "s/^AllowUsers/� userc/" -i /etc/ssh/sshd_config

But this appears to add userc directly after AllowUsers and not after userb

View 2 Replies View Related

General :: Command Line - Print A Group Of Text Matching A Regex?

Sep 22, 2011

I'd like to print only few groups from text matching a regex. How can I do that in the Linux command line?

What other tools for text processing are there in Linux?

View 3 Replies View Related

General :: Printing From Command Line Won't Work - Just Sits In Print Queue

Apr 3, 2011

CUPS was not originally installed on my server, I have installed it but cannot print to my network printer. On my laptop, I can... they are both running the same version of Debian. What could be missing?

Here are some details...

I have two computers running the same version of Debian. One is a server with no GUI and the other is my laptop with GDM installed. My laptop (which prints with no problem) is connected via Wifi. My server is connected directly to the router via Ethernet. I cannot print from the server.

The printer is a Canon Pixma MP495 that connects to the router via Wifi. I have downloaded drivers for the printer from [url] and installed them successfully using dpkg on both computers.

Right now I have a regular text file that I am using for a test page. To print from my laptop (with success) I type:

Code:

This does not work from the server. What could I be missing?

lpq run on server:

Code:

lpinfo readout:

Code:

View 14 Replies View Related

General :: Command Line Options - Listing MP3 Over Certain Size

Jan 6, 2011

How would I list every mp3 over a certain size on an entire hard drive?

View 1 Replies View Related

Software :: Command Line To Increase Size Of Script

Aug 27, 2010

I'm running Fedora 13. On a full screen terminal how do I increase the the size of the script.

View 4 Replies View Related

Programming :: Replacing Set Of Characters In A Specific Line Using Sed Or Awk?

Dec 29, 2010

I would like to replace 'xxxx' with 'yyyy' which is in a file xyz.csproj not sure of what 'xxxx' is, it can be 3055, 4056, 7089 etc. I know it always appears at line # 5 and at character 50.

<Reference Include="System.Management" />
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Windows.Forms" />

[code]....

View 14 Replies View Related

Programming :: Gawk -- Print In A New Line Without Overwriting?

Sep 20, 2010

I have a directory where there are folders and in them some .txt data files. I am trying to output a .txt file with the folder name and the number of .txt files in it using gawk. However, when I run my shell program, because print is nested in a "while" loop, gawk overwrites what's already saved in the output file. I want gawk to print "new" output in a new line without overwriting the already existing text in the output fil

#! /bin/sh
# getting the folder list and the number of folders
ls | gawk '{print}' > ../folder_list.txt

[code]...

View 6 Replies View Related

Programming :: Print A Line Of Fill Character In C?

May 15, 2010

As you know, in C++ you can use setfill(char c); and setwidth( int length) to fill a line of a character.
It's line making a line of a character for output

Code:
NAME DEPARTMENT LOCATION
==========================================
Pete R&D Chicago
...
==========================================
As you see, a line of a '=' character drawn to output.

I'm wondering, how can I draw this line in C using printf() to format?
( no loop or repetiton )

View 8 Replies View Related

General :: TIP: Reducing PDF File Size From The Command Line With GhostScript (gs)?

Jan 14, 2011

I've spent hours trying to scan + shrink a multipage PDF documentlosing readability. This is the first time I've ever needed to do this! (I had to scan each page as ".jpg" in order to email and open on another computer, so I could not scan to PDF directly, which I think is why each page was so large; lower DPIs made the text too blurry.)I found this great tip on UbuntuGeek...but anyone can do this if GhostScript is installed:

View 1 Replies View Related

SUSE / Novell :: Vncviewer Command Line For View Size?

Aug 8, 2010

I use vncviewer command line to remote access my pc from my notebook.
Is there any option to resize the view like windows client can by percentage?
my notebook screen size is 1280x800, while I use bigger resolution for my pc 1280x1024 if not mistaken.
already look here: http://linux.die.net/man/1/vncviewer but I don't see any option to do that.

View 9 Replies View Related

Programming :: Append Variable String In A Specific Line?

Jun 8, 2010

I want to append a variable string to the end of a specific line. not like append the same string to each line. like in my file i have 4 columns, i want to add a string in 5th column in some fixed row.

View 4 Replies View Related

Ubuntu :: Command Line (write A Short Script That Will Compress A Specific Folder) - 7zip

Oct 6, 2010

i need to write a short script that will compress a specific folder that`s on the Desktop (and all it`s content) and also will encrypt it with a password that is inside the script --->meaning it wont ask for a password+verification when compressing+encrypting

View 1 Replies View Related

General :: Command Line To Check For A Specific Email - By Subject - On An SSL Secured IMAP Server?

Feb 1, 2011

Anyone know a simple command line to check for a specific email - by subject - on an SSL secured IMAP server?

View 2 Replies View Related

Red Hat / Fedora :: Changing Font Size Or Style In Command Line Interface?

Mar 23, 2010

if its possible to change font size or style on CLI.

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved