Page 21 of 21

Re: SheetMaker for Linux

PostPosted: Wed Jul 27, 2016 12:30 am
by bunyip1
mad_ady wrote:@bunnyip: I think you're overcomplicating things :) Here's something new to try - how about windows 10 new "linux shell" feature? You could install perl, modules and everything and use an Xserver for display and have a single code. True, not all windows versions are supported, but at least it will be futureproof. ... ash-shell/

Hi mad_ady,

Anything to do with MS is over-complicated.

Yes, I have been reading about this with much scepticism. If only life were that simple. It could be a long time before you can run Graphical Linux apps seamlessly this way. And how long before MS start patenting bits of Linux and licensing raises its ugly head.

I'll stick to the real Linux thanks.

BTW: I'm going to have to ban you if you don't start getting my name right :P . I'm not a cute furry animal I'm much more savage (see

Re: SheetMaker for Linux

PostPosted: Wed Jul 27, 2016 1:51 am
by mad_ady
Yikes, my bad... I remember the "boogie man" reference, but I still read it "BunnyIP" in my head, sorry... :D

Re: SheetMaker for Linux

PostPosted: Sat Dec 10, 2016 12:28 pm
by mad_ady
@bunyip1: I'd like to ask you for your advice. I want to make a script to generate an image (periodically) containing some elements at various offsets. Very much like a moviesheet based on an xml (or some other datatype) template, but the data is arbitrary - (eg. weather, current time, current playing song, etc).
I know your engine already does this, but:
1. Have you encountered/can you recommend a piece of software that already does what I need?
2. If I were to reuse your work, could I:
2.1 Run non-interactivelly and
2.2 Use different tags than moviesheets, but the same general structure
2.3 Feed my data in instead of what got scraped from imdb/etc
2.4 Generate an image of arbitrary dimensions?

If #2 is a viable option can you point me to the relevant blocks of code (I'm fluent in perl)?

PS. Is it possible to use relative positioning in the template? I need to accomodate several resolutions (480x360, 1024x600, 1024x768, 1080p). But I guess one template won't look good...

Re: SheetMaker for Linux

PostPosted: Sun Dec 11, 2016 2:13 am
by bunyip1
Hi mad_ady,

I don't know of any tools that would do this, but then I never searched for one. Generally find it easier to create my own tools to suit whatever task I need to perform.

The option to re-use SML (now called SMK) code should be relatively easy. Particularly now that I have version 2 almost ready for release.
In version 2, I have separated all functional code groups into individual Perl Packages, so now there is a package called '' which houses all the graphical stuff and can be called by any perl script.
If we strip out the SMK stuff (which isn't much) and modify the inputs slightly, then we have a pretty good start on a general image creator.

In the Package there are only three functions you need to consider -
'Canvas' - start a new image of any specified size, either blank or using an existing image.
'Add Text' - add text to the existing canvas - using specified attributes.
'Add Image' - add an external image - using specified attributes.

The simplest approach would be to have your script call these functions and pass a relevant 'XML' data string similar to that used by the moviesheet templates containing all the required attributes for the text or image.

For example to add a bit of text, pass a string like this..
Code: Select all
<TextElement Name="Text" X="38" Y="69" Width="1100" Height="20" AutoSize="False" Multiline="False" Font="Helvetica,10,True,False,False,False,Point,,0" ForeColor="-2500135" StrokeColor="-16777216" StrokeWidth="0" Text="Text I want to appear" TextAlignment="TopLeft" TextQuality="AntiAlias" TGD_IsLocked="False" TGD_IsVisible="True">
<DropShadow Angle="320" Color="-16777216" Distance="3" Opacity="100" Softness="2" TGD_IsVisible="True" />

The more long-term approach would be to modify the SMK_Magick package inputs to take say an attribute hash from your script.
$text_attributes->{forecolor} .. etc.

As for Documentation, the code is fairly self explanatory, particularly if you read it in conjunction with one of the templates.
You can also refer to the 'Perl-Magick API' documentation to get a more technical understanding.

The positioning of elements in ImageMagick are absolute x/y pixel co-ordinates from the top left corner of the canvas, but it's easy enough to calculate absolute from relative, since you will know the canvas size and position of each element you have already placed on the canvas.

Let me know what you think - I can provide the '' for you to play with.

Re: SheetMaker for Linux

PostPosted: Sun Dec 11, 2016 12:59 pm
by mad_ady
Sounds great! I'd like to play with it (although I'm not sure I'll have time till february, so if you're reworking stuff I can wait).

Regarding the xml structure - is there any formal definition? Did it originate from wdtv's format or is it closer to imagemagik? Also, can you recommend a template editor/previewer?

Re: SheetMaker for Linux

PostPosted: Sun Dec 11, 2016 3:46 pm
by bunyip1
You have given me something to think about, I'm intrigued by the thought of making a generic version of I'm going to do some toying myself.

You can pick up a unaltered version => here if you want to have a look yourself.

You may recall that SheetMaker was born out of need for Linux users to have a tool for their WDTV devices like the popular 'ThumbGen' for windows which had already set data and template standards. So SML was designed to be able to use this data (TGMD files) and existing available templates. So the template documentation came from ThumbGen and he also created a windows-based template editor. You should try and track down his docs and software (they are now open-source).

I'll let you know when I have a 'generic' version of available, but feel free to experiment on the current one.


(Edited: Spelling)

Re: SheetMaker for Linux

PostPosted: Sun Dec 11, 2016 10:37 pm
by mad_ady
I've looked over your code and looks "generic" enough. I don't think you need to modify it much. I was worried that the actual tags (director, plot, synopsis) were somehow hardcoded in the generation process.

I see that the constructor process takes a template or a type (which is not used) and a data reference. Care to share what the data structures you're passing are? I'm not really sure how one passes the actual values. Or are they merged with the template before passing (e.g. the template has the internal variables already replaced)?

Also, I could probably use Common::SMK_Common, since it's referenced.


Re: SheetMaker for Linux

PostPosted: Mon Dec 12, 2016 3:37 am
by bunyip1
Hi mad_ady,

You can delete the following - they are SMK specific..
use Common::SMK_Common; - (Only needed to link back to the data substitution routines that you wont need).
my $type = shift; - (no longer used and will be dropped in the new version).
remove the whole subroutines "BuildThumbnail" and "GetTrickleCovers".
remove all lines containing reference to 'SMK_Window_GTK' or 'SMK_Common' - (Data substitution again)
You can drop out the section that deals with displaying 'RATINGSTARS'.

One new feature in Version 2 will be the option to generate a sheet using only a Background image and not apply a template (similar to the generation of a Cover). So the '$data' input is optional and is used to specify the path to the 'Background' image.

The SMK method is to build the whole image is one call - all instructions being in the template, so if you want to do this then your script would create it's own run-time template and pass it to the SMK_Magick package.

But if you want to build up an image step by step from your own script you will want to do separate calls for each text or image element you want to add to base image. For this you will need to pass the working image back to SMK_Magick each time you want to add something (similar to the $data input variable mentioned previously).

HOWEVER to make things simpler I have created a modified version of (with the above changes) to be more generic, and included a test script to illustrate how you might use it.
Get these examples => here.

Re: SheetMaker for Linux

PostPosted: Mon Dec 12, 2016 3:59 am
by mad_ady
Thank you for your help.
But your link was wrong. This is the correct link (for posterity):

Your example works correctly. It will be a good base to start off. I'll show off the results once I'm done. The plan is to display date/weather/alarm information on this display: ... 7435282441

Re: SheetMaker for Linux

PostPosted: Mon Dec 12, 2016 4:06 am
by bunyip1
Yeah I fixed the link - too many http:// leaders.
Sounds good - you could probably cull the bits you dont use out of the final product too.