Dirk Published on July 14, 2008
by Dirkpro

Dirk's blog

Browse posts
Wie Freenet mich beschissen hat …
Posted on January 20, 2009
3 comments (latest 8 weeks ago)
Are there promotional ipernity icons?
Posted on November 29, 2008
4 comments (latest 10 months ago)
Gruppen: Unmöglich (groups: impossible)
Posted on September 26, 2008
3 comments (latest 13 months ago)
IPEdit, Upload-Vorbereitungs-Scri pt (upload preparation script)
7 comments (latest 16 months ago)
Kein „Pro“ mehr - Not “Pro” anymore :(
Posted on July 8, 2008
5 comments (latest 16 months ago)
Spam @ ipernity?
Posted on July 2nd, 2008
10 comments (latest 9 months ago)
ipeRSS 3.0.0-beta3
Posted on July 1st, 2008
ipeRSS-Vorveröffentlichun g (ipeRSS pre-release)
Posted on April 7, 2008
9 comments (latest 19 months ago)
ipeRSS-Update!
Posted on December 22, 2007
11 comments (latest 19 months ago)

Keyword tags

upload
linux
copyright
imagemagick
convert
shellscript
mogrify
caption

Member tags

Byggvir of Barley

More information

This post is public
Attribution + share Alike
  1. Read 858 times

IPEdit, Upload-Vorbereitungs-Script (upload preparation script)

Monday July 14, 2008 at 11:41AM

Dies ist ein Script, mit dem man - wohlgemerkt nur an der bash, also unter Linux - Bilder für das Hochladen auf ipernity vorbereiten kann. Ausführliche Kommentare dazu, was die einzelnen Variablen bewirken, befinden sich in der runterladbaren Version: kamerastars.de/daten/IPEdit.

This is a script with this you can - well, only at the bash, thus under Linux - prepare images for uploading them at ipernity. A fully documented version of this script is downloadable at this location: kamerastars.de/daten/IPEdit.

Vielleicht kann das ja einer von euch gebrauchen.
Maybe one of you has a use for this

Die Version zum Runterladen wird regelmäßig erweitert
The download version will be extended time by time

#!/bin/bash
# IPEdit lite - Editing pictures for uploading them to ipernity.com
# Author: Dirk Sohler, http://blog.schlunzen.org - http://dirk.ipernity.com
# Licensed under CC-by-sa, http://creativecommons.org/licenses/by-sa/3.0/

# Use at your own risk!


# Base
MAXWIDTH="800"
MAXHEIGHT="600"
DIRECTORY="${HOME}"
PREFIX="edited_"

# Caption
CAPTION=""
FONT=""
TEXTCOLOR=""
TEXTPOS="5,5"

# Tools
CONVERT=`which convert`
MOGRIFY=`which mogrify`


# Check

if [ ! -e $CONVERT ]; then
  echo "The convert tool was not found. Do you have ImageMagic installed?"
  exit 11
fi

if [ ! -e $MOGRIFY ]; then
  echo "The mogrify tool was not found. Do you have ImageMagic installed?"
  exit 12
fi

if [ ! -d "${DIRECTORY}" ] || [ ! -w "${DIRECTORY}" ]; then
  echo "The given path is not writable (or is no directory)"
  exit 21
else
  cd "${DIRECTORY}"
fi


# Edit

INDEX=0

for PICTURE in *.jpg
  do

    ${CONVERT} -quality 100 -geometry ${MAXWIDTH}x${MAXHEIGHT} \
               "${PICTURE}" "${PREFIX}${PICTURE}"

    if [ `echo ${CAPTION} | wc -c` -gt 1 ]; then
      $MOGRIFY -quality 100 -gravity SouthEast -pointsize 16 \
               -family ${FONT} -fill ${TEXTCOLOR} \
               -draw "text ${TEXTPOS} \
               \"$CAPTION\"" "${PREFIX}${PICTURE}"
    fi

  ((INDEX++))

  done


# Finish

echo "Edited ${INDEX} pictures"

7 Comments / add your comment?

Byggvir of Barleypro says:
Das ist ja schon sehr komfortabel. Da werd ich ein paar Ideen von klauen.
Posted 16 months ago. ( permalink / translate )
Dirkpro replies:
Na ich hoff’ doch! -pointsize könnt ich auch noch mit ’ner Variablen erschlagen. -gravity natürlich auch noch. Unterscheidet sich ja nicht sonderlich vom anderen Kram. Wenn nicht geschehen, lad’ am besten die kommentierte Version :)

--
Seen on Ipernity home page (?)
Posted 16 months ago. ( permalink / translate )
Dirk edited this comment 16 months ago.
Kiezkicker says:
Schade, mach ich schon mit gimp (weil ich eh in raw fotografiere), aber gut zu wissen, dass überhaupt noch jemand lebt, der auch nen linux nutzt. Das lässt hoffen (und speziell der letzte Kommentar im Script sowieso). :)
Posted 16 months ago. ( permalink / translate )
Dirkpro replies:
Nja, ich schieb das einfach vor mir her. Die API steht ja schon zum teil. ipeRSS soll die ja auch irgendwann mal nutzen. Aber ich bin schlicht zu faul, mich da in die Entwickler-Doku einzulesen, ich warte lieber, bis ipernity ’ne Newbie-Fassung raus gibt ;)

--
Seen on Ipernity home page (?)
Posted 16 months ago. ( permalink / translate )
Kiezkicker replies:
Entwickler - Doku zur API von Ipernity? Wo ist die?
Posted 16 months ago. ( permalink )
Dirkpro replies:
in irgendeinem Blogpost von Team Ipernity wurde das mal angesprochen. Ein Teil der flick-Syntax funktioniert, und es wurden Rückgabewerte beschrieben, ich finde das nur grade nicht unter „API“ als Stichwort. Kann auch sein, dass Christophe es mal angesprochen hat.

War aber alles noch sehr undokumentiert :)

--
Seen in my account recent activity (?)
Posted 16 months ago. ( permalink / translate )
Kiezkicker replies:
Ah, aber das klingt ja zumindest schonmal vielverspechend, dann wird man das Rad ja nicht komplett neu erfinden, sondern bestehende Sachen eben nur noch ein wenig anpassen müssen. :)
Posted 16 months ago. ( permalink / translate )

Add your comment

Reply to this comment

Edit your comment

Please sign in to post a comment Sign in now?


rss Latest comments – Subscribe to the feed of comments related to this post.

 

Català | Čeština nové | 中文 | Deutsch | English | Español | Esperanto | Ελληνικά | Français | Galego | Italiano | Nederlands | Português | More...