View Single Post
Old 09-27-2013, 04:58 PM   #440
Dyspeptica
Enthusiast
Dyspeptica began at the beginning.
 
Posts: 27
Karma: 10
Join Date: May 2012
Device: iPad
There are some things which calibre just cannot do when dealing with cover images and captions. For that you need to get outside of calibre and look at the ImageMagick suite of tools, in particular the 'convert' program and its caption tag. which has been tweaked in recent revisions to properly wrap a long title line, into a display box (rather than overhanging at each end). Best yet, this can be done with variable scripting, so doing 3750 covers is as difficult as doing one. Just push 'GO' and go for coffee!

I needed/wanted 3 sections to the cover image title, and a publisher banner. The bash code looks something like this.

echo $line1 > "${captionfile}" # Investment abd Lending activities....
echo $line2 >> "${captionfile}" # O.Reg. 122/08
echo $line3 >> "${captionfile}" # Insurance Act

#captionfile has three lines in it

label="${captionfile}"
# so $label is the name of the file: caption will deal with each line in order

# the main work is done here
# lt.png is the background image on which the titles will appear

rm -f label1.png
rm -f label2.png
rm -f output1.png
rm -f output2.jpg

# create title overlay
convert -background black -transparent black -font "Liberation-Serif" -pointsize 36 -fill "dark blue" -size 720x440 -gravity center caption:@"${label}" label1.png

# then create publish-banner overlay image
convert -background black -transparent black -font "Liberation-Serif" -pointsize 36 -fill "dark blue" -size 760x80 -gravity center caption:'MANDAMUS PUBLISHING INC.' label2.png

# compose first overlay
composite -geometry +35 label1.png lt.png -blend 99 output1.png
# add second overlay to the first -> cover image
composite -geometry +20+900 label2.png output1.png -blend 99 output2.jpg

# and output2.jpg is your cover image to be used with ebook-convert --cover output2.jog

convert can also re-size images
See the sample jpg attached, It has a long first line which is wrapped and balanced in the 'write-box' which I note is actually not quite centered!
Attached Thumbnails
Click image for larger version

Name:	080122-e.jpg
Views:	479
Size:	127.0 KB
ID:	112287  
Dyspeptica is offline   Reply With Quote