[Gimp-user] Scripting - How to save JPEG with thumbnails

2007-05-07 Thread Guillaume Bonillo
Hi,

I am new to scheme scripting.
What i want to do is open pictures from a directory and apply a very 
simple macro.

I can do it manually with the following steps :
- open image the_image.jpg.
- save as  the_image_with_thumbnail.jpg
- choose options : q = 0.85 , progressive, and default other options.
- check the option : save thumbnail.
- Click OK.
- close image.

Could someone show me some sample scripts to do that ?
I've found several way to save a thumbnail in jpg or png format in a 
separate file,
but did not find any script matching the steps i've exposed ...

Thanks for any reply

G.B.
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Scripting - How to save JPEG with thumbnails

2007-05-07 Thread Guillaume Bonillo

Guillaume Bonillo a écrit :

Paul Surgeon a écrit :

On Monday 07 May 2007 11:37, Guillaume Bonillo wrote:
  

Hi,

I am new to scheme scripting.
What i want to do is open pictures from a directory and apply a very
simple macro.

I can do it manually with the following steps :
- open image the_image.jpg.
- save as  the_image_with_thumbnail.jpg
- choose options : q = 0.85 , progressive, and default other options.
- check the option : save thumbnail.
- Click OK.
- close image.



Using a bash script or DOS batch file with imagemagick is a better and easier 
solution.


Below is a bash script that I use to create thumbnails of photos from my 
digital camera.
You can pass the jpg quality parameter to convert - I used the default which 
is 75% I think. The options are in the docs.


-

#!/bin/bash

echo Converting ...

if [ ! -d resized-1024x768 ]
then
  mkdir resized-1024x768
fi

if [ ! -d resized-256x192 ]
then
  mkdir resized-256x192
fi

# Loop through all jpg files in current folder
# 
for i in *.jpg
do
  FileName_Stripped=`echo $i | cut -d. -f1`

  if [ ! -e resized-1024x768/$FileName_Stripped-1024x768.jpg ]
  then
echo Converting $i to $FileName_Stripped-1024x768.jpg
convert -resize 1024x768 
$i resized-1024x768/$FileName_Stripped-1024x768.jpg

  fi

  if [ ! -e resized-256x192/$FileName_Stripped-256x192.jpg ]
  then
echo Converting $i to $FileName_Stripped-256x192.jpg
convert -resize 256x192 
$i resized-256x192/$FileName_Stripped-256x192.jpg

  fi
done

echo Done

-
  

Thank you very much for pointing this tool to me.
However ...
I can't find in imagemagick the ability to save thumbnail as EXIF data 
in the jpeg, and not in a different picture.


Ok, so if someone want to write Exif thumbnail to jpeg i've done this 
with imagemagik and exiftools to write thumbnail generated by imagemagik...
Maybe there's a better way to do this but this tools works just as 
expected and there's no loss of other exif info.


But if someone ever got a scheme script to do that through GIMP ... i'am 
interested


Thanks list !
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Scripting - How to save JPEG with thumbnails

2007-05-07 Thread Sven Neumann
Hi,

On Mon, 2007-05-07 at 11:37 +0200, Guillaume Bonillo wrote:

 I am new to scheme scripting.
 What i want to do is open pictures from a directory and apply a very 
 simple macro.
 
 I can do it manually with the following steps :
 - open image the_image.jpg.
 - save as  the_image_with_thumbnail.jpg
 - choose options : q = 0.85 , progressive, and default other options.
 - check the option : save thumbnail.
 - Click OK.
 - close image.

It's acutally a bad idea to do that. When you are opening a JPEG file
and saving it again as JPEG, you are recompressing it and this
recompression means a loss of quality. This can be avoided by using a
tool that manipulates the JPEG file without recompressing the image
data. Such tools are available and they can even rotate the image for
you without decompressing the image data. See for example exiv2
(http://www.exiv2.org/). The manual page says that it can insert
thumbnails.


Sven


___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user