glantucan
August 15th, 2008, 11:24 PM
Hello all
I'm trying to code a front-end for several image and video editing tools with bash. My goal is to build a sort of suite for photographic workflow and for stop-motion animation production. That's it, but it's not so short to do it.
At the moment I'm just trying to:
Select a few raw files from nautilus and open a dialog which allows to preview the jpg image embeded in them (this is done via ufraw)
Choose the file I want to use as "template" open it with ufraw, develop the "digital film" and apply all those settings to all previously selected images using ufraw-batch and save them all as jpg or png.
Post-process the images through ImageMagick using a dialog which allows basic image manipulation like brighness, contrast, hue, saturation etc. control thorugh ImageMagick
That's enough for the beginning.
Of course I could use gimp for all those things, but what I want is a batch processing utility. Gimp has its scripting capabilities, but if I have to learn I prefer to extend my bash knowledge than trying to learn the script-fu alien syntax :P. And of course ImageMagick seems to do its job very well and it's well documented.
What I would not imagine is my main problem to come from gtkdialog that at the beginnig looked so promising, and now is giving me such a headache.
Step 1 listed above it's done if I use a external program to do the job of previewing. But I invested a lot of trial and error on getting the image preview on a pixmap widget. The point here is that I don't want to save the image preview to the hard disk, so I'm using pipes all the time.
Currently I use this, redirecting the output of ufraw to the Imagemagick tool display
ufraw-batch --create-id=also --out-type=jpeg --output=- --size=400 --embedded-image $1 | display -
How could I insert it directly on the pixmap widget directly without saving it?.
Step 2 is almost done and has nothing to do with gtkdialog
Step 3 is just not started, because I can't find a way to make faders for adjusting convert(ImageMagick) parameters.
This is test script I'm working with
#!/bin/bash
archivos=$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
#function ChannelPreview {
#ufraw-batch --create-id=also --out-type=jpeg --output=- --size=400 --embedded-image $1 | convert - -channel B -separate - | display -
#}
# This generates the tags needed to feed the table with the file names
archItems=$(echo $archivos | sed -e "s_[^ ]*_<item>&</item>_g" )
export MAIN_DIALOG="
<vbox>
<table>
<height>150</height><width>550</width>
<variable>TABLE</variable>
<label>Choose a file to start</label>
$archItems
<action>~/bin/__istDs2jpeg_THESE_actions.sh preview \$TABLE &</action>
</table>
<hbox>
<button ok></button>
<button cancel></button>
</hbox>
</vbox>"
gtkdialog --program=MAIN_DIALOG
unset MAIN_DIALOG
#clear
exit 0
Some weird things I don't understand:
I can't call in any way I know a local (I mean inside this script) function from an <action> tag. That's the reason the ChannelPreview function is commented out; but I can call a function inside another script with no problem !!!!!?????
As you can see variable syntax like $archItems is accepted in some places but inside <action> I had to use \$TABLE. Is it because the first one is defined in the bash part of the script and the latter is defined inside the xml for the gtkialog?
I can't find any good tutorial, manual or reference on gtkdialog. The documentation just sucks (sorry, but it's the truth) and it is not complete at all. I tried all my googling knowledge to find almost nothing. So I hope someone can help me if it is using it.
](*,)
Thanks
Glantucan
I'm trying to code a front-end for several image and video editing tools with bash. My goal is to build a sort of suite for photographic workflow and for stop-motion animation production. That's it, but it's not so short to do it.
At the moment I'm just trying to:
Select a few raw files from nautilus and open a dialog which allows to preview the jpg image embeded in them (this is done via ufraw)
Choose the file I want to use as "template" open it with ufraw, develop the "digital film" and apply all those settings to all previously selected images using ufraw-batch and save them all as jpg or png.
Post-process the images through ImageMagick using a dialog which allows basic image manipulation like brighness, contrast, hue, saturation etc. control thorugh ImageMagick
That's enough for the beginning.
Of course I could use gimp for all those things, but what I want is a batch processing utility. Gimp has its scripting capabilities, but if I have to learn I prefer to extend my bash knowledge than trying to learn the script-fu alien syntax :P. And of course ImageMagick seems to do its job very well and it's well documented.
What I would not imagine is my main problem to come from gtkdialog that at the beginnig looked so promising, and now is giving me such a headache.
Step 1 listed above it's done if I use a external program to do the job of previewing. But I invested a lot of trial and error on getting the image preview on a pixmap widget. The point here is that I don't want to save the image preview to the hard disk, so I'm using pipes all the time.
Currently I use this, redirecting the output of ufraw to the Imagemagick tool display
ufraw-batch --create-id=also --out-type=jpeg --output=- --size=400 --embedded-image $1 | display -
How could I insert it directly on the pixmap widget directly without saving it?.
Step 2 is almost done and has nothing to do with gtkdialog
Step 3 is just not started, because I can't find a way to make faders for adjusting convert(ImageMagick) parameters.
This is test script I'm working with
#!/bin/bash
archivos=$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
#function ChannelPreview {
#ufraw-batch --create-id=also --out-type=jpeg --output=- --size=400 --embedded-image $1 | convert - -channel B -separate - | display -
#}
# This generates the tags needed to feed the table with the file names
archItems=$(echo $archivos | sed -e "s_[^ ]*_<item>&</item>_g" )
export MAIN_DIALOG="
<vbox>
<table>
<height>150</height><width>550</width>
<variable>TABLE</variable>
<label>Choose a file to start</label>
$archItems
<action>~/bin/__istDs2jpeg_THESE_actions.sh preview \$TABLE &</action>
</table>
<hbox>
<button ok></button>
<button cancel></button>
</hbox>
</vbox>"
gtkdialog --program=MAIN_DIALOG
unset MAIN_DIALOG
#clear
exit 0
Some weird things I don't understand:
I can't call in any way I know a local (I mean inside this script) function from an <action> tag. That's the reason the ChannelPreview function is commented out; but I can call a function inside another script with no problem !!!!!?????
As you can see variable syntax like $archItems is accepted in some places but inside <action> I had to use \$TABLE. Is it because the first one is defined in the bash part of the script and the latter is defined inside the xml for the gtkialog?
I can't find any good tutorial, manual or reference on gtkdialog. The documentation just sucks (sorry, but it's the truth) and it is not complete at all. I tried all my googling knowledge to find almost nothing. So I hope someone can help me if it is using it.
](*,)
Thanks
Glantucan