Sponsored Content
Full Discussion: print metadata to jpg
Top Forums Shell Programming and Scripting print metadata to jpg Post 302484116 by rdcwayx on Wednesday 29th of December 2010 08:28:51 PM
Old 12-29-2010
Code:
source=ML.JPG
target=target.JPG

set -- $(identify $source |awk 'NR==1{split($3,a,"x"); print a[1],a[2]}')   # get the image's size, width=$1, length=$2, you need adjust for your image, depand the output format of command identify
                   
jhead $source |grep "GPS" |awk -v width=$1 -v length=$2 -v sfile=$source -v tfile=$target '
NR==1{Latitude=$0}NR==2{Longitude=$2} NR==3{Altitude=$0}
END{print "convert -pointsize 18 -font /path/to/font.ttf -fill white -stroke black -strokewidth 1 -draw \" "Latitude, " 10," length-72 "\" -draw \" "Longitude, " 10," length-54 "\" -draw \" "Altitude, "  10," length-36 "\" ",sfile, tfile}'

convert is imagemagick command. if output is fine, just copy the output and run it directly.

Last edited by rdcwayx; 12-29-2010 at 09:35 PM..
This User Gave Thanks to rdcwayx For This Post:
 

5 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Print the content of a directory in jpg file

Is there any possible way to print the contents of a directory to a .jpg file? I have a list of thumbnails (e-books) which I want to share (+500) but I don't know how to make this. I would appreciate a lot any comments regarding this issue. (4 Replies)
Discussion started by: agasamapetilon
4 Replies

2. Programming

Best way to dump metadata to file: when and by who?

Hi, my application (actually library) indexes a file of many GB producing tables (arrays of offset and length of the data indexed) for later reuse. The tables produced are pretty big too, so big that I ran out of memory in my process (3GB limit), when indexing more than 8GB of file or so.... (9 Replies)
Discussion started by: emitrax
9 Replies

3. Shell Programming and Scripting

Rename all ".JPG" files to ".jpg" under all subfolders...

Hi, Dear all: One question ! ^_^ I'm using bash under Ubuntu 9.10. My question is not to rename all ".JPG" files to ".jpg" in a single folder, but to rename all ".JPG" files to ".jpg" in all subfolders. To rename all ".JPG" to ".jpg" in a single folder, for x in *.JPG; do mv "$x"... (7 Replies)
Discussion started by: jiapei100
7 Replies

4. UNIX for Advanced & Expert Users

LVM - restore metadata on other disk

Hi guys, I would like to ask your opinion about my theory, how to fix my broken LVM without risking any data loss. I use Archlinux at home. I just love this distro, even it gives me a lots of work (particularly after system updates). Basic system spec: AMD FX(tm)-6100 Six-Core Processor... (1 Reply)
Discussion started by: lyynxxx
1 Replies

5. UNIX and Linux Applications

About gvfsd-metadata

I need a hint about gvfsd-metadata using mate on bsd. Or dual-core cpu, quad-core cpu ore an old laptop single core, the gvfsd is an obstacle and does not accelerate anything, vice versa, it slows down many processes, coming from gnome. So someone can give me a hint how to wipe it out for good? I... (1 Reply)
Discussion started by: 1in10
1 Replies
XDrawImageString(3X11)													    XDrawImageString(3X11)

NAME
XDrawImageString, XDrawImageString16 - draw image text SYNOPSIS
XDrawImageString(display, d, gc, x, y, string, length) Display *display; Drawable d; GC gc; int x, y; char *string; int length; XDrawImageString16(display, d, gc, x, y, string, length) Display *display; Drawable d; GC gc; int x, y; XChar2b *string; int length; ARGUMENTS
Specifies the drawable. Specifies the connection to the X server. Specifies the GC. Specifies the number of characters in the string argument. Specifies the character string. Specify the x and y coordinates, which are relative to the origin of the specified drawable and define the origin of the first character. DESCRIPTION
The XDrawImageString16 function is similar to XDrawImageString except that it uses 2-byte or 16-bit characters. Both functions also use both the foreground and background pixels of the GC in the destination. The effect is first to fill a destination rectangle with the background pixel defined in the GC and then to paint the text with the fore- ground pixel. The upper-left corner of the filled rectangle is at: [x, y - font-ascent] The width is: overall-width The height is: font-ascent + font-descent The overall-width, font-ascent, and font-descent are as would be returned by XQueryTextExtents using gc and string. The function and fill- style defined in the GC are ignored for these functions. The effective function is GXcopy, and the effective fill-style is FillSolid. For fonts defined with 2-byte matrix indexing and used with XDrawImageString, each byte is used as a byte2 with a byte1 of zero. Both functions use these GC components: plane-mask, foreground, background, font, subwindow-mode, clip-x-origin, clip-y-origin, and clip- mask. XDrawImageString and XDrawImageString16 can generate BadDrawable, BadGC, and BadMatch errors. DIAGNOSTICS
A value for a Drawable argument does not name a defined Window or Pixmap. A value for a GContext argument does not name a defined GCon- text. An InputOnly window is used as a Drawable. Some argument or pair of arguments has the correct type and range but fails to match in some other way required by the request. SEE ALSO
XDrawString(3X11), XDrawText(3X11), XLoadFont(3X11), XTextExtents(3X11) Xlib -- C Language X Interface XDrawImageString(3X11)
All times are GMT -4. The time now is 07:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy