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
XDrawString()															     XDrawString()

Name
  XDrawString - draw an 8-bit text string, foreground only.

Synopsis
  XDrawString(display, drawable, gc, x, y, string, length)
	Display *display;
	Drawable drawable;
	GC gc;
	int x, y;
	char *string;
	int length;

Arguments
  display   Specifies a connection to an X server; returned from XOpenDisplay().

  drawable  Specifies the drawable.

  gc	    Specifies the graphics context.

  x	    Specify  the  x  and  y  coordinates of the baseline starting position for the character, relative to the origin of the specified
  y	    drawable.

  string    Specifies the character string.

  length    Specifies the number of characters in string.

Description
  XDrawString() draws the given string into a drawable using the foreground only to draw set bits in the font.	It does not affect any	other
  pixels in the bounding box for each character.

  The  y  coordinate defines the baseline row of pixels while the x coordinate is the point from which lbearing, rbearing, and width are mea-
  sured.

  XDrawString() uses these graphics context components:  function, plane_mask, fill_style, font, subwindow_mode,  clip_x_origin,  clip_y_ori-
  gin,	and  clip_mask.   This	function  also	uses these graphics context mode-dependent components: foreground, background, tile, stipple,
  ts_x_origin, and ts_y_origin.  Each character image, as defined by the font in gc, is treated as an additional mask for a fill operation on
  the drawable.

  For more information, see Volume One, Chapter 6, Drawing Graphics and Text, and Chapter 5, The Graphics Context.

Errors
  BadDrawable
  BadGC
  BadMatch

See Also
  XDrawImageString(), XDrawImageString16(), XDrawString16(), XDrawText(), XDrawText16(), XQueryTextExtents(), XQueryTextExtents16(), XTextEx-
  tents(), XTextExtents16(), XTextWidth(), XTextWidth16().

Xlib - Text															     XDrawString()
All times are GMT -4. The time now is 04:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy