<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Oups, sorry, I made some mistakes...<br>
<br>
So, first mistake, if you are using a command line you should only have
one % and not two %%. On the contrary, if you are using a bat file, you
should have two %%.<br>
Next, I forgot a ~ in the DO syntax it should be %%~nxg and %%~ng.<br>
<br>
So, from the command line, the correct syntax is :<br>
<blockquote>FOR %g in (C:\conversion_tif_bin\*.bing) DO gdal_translate
-of JPEG "C:\conversion_tif_bin\%~nxg" "C:\conversion_tif_bin\%~ng.jpg"<br>
  <br>
</blockquote>
I haven't looked at your image at the moment...<br>
<br>
Regards,<br>
Beno&icirc;t Andrieu<br>
<br>
<br>
Le 12/02/2010 16:18, Carlos Padovani a &eacute;crit&nbsp;:
<blockquote
 cite="mid:16f071851002120818k60e52b0fsb759932bca9c33ce@mail.gmail.com"
 type="cite">
  <div>Dear Beno&icirc;t,</div>
  <div>I am doing some thing wrong, but I do not know what.</div>
  <div>I am sending a figure "path" with the path and another figure
"FWTools_Shell_error" with the error message of the FWTools Shell. The
message of error is "%%g foi inesperado neste momento", it is in
Portuguese and means&nbsp;something like&nbsp;"%%g was unexpected at the
moment".&nbsp;You can see in the figure "FWTools_Shell_error" how I typed
the path and other data necessary. I would like more help on this if
possible.<br>
Sorry but I sent the wrong image. I am sending the right one now
"image1" with the data you required.</div>
  <div>No. of columns: 600 <br>
No. of rows: 600<br>
No. of bands: 1&nbsp;(gray)</div>
  <div>Data type: Binary 16-bit integer<br>
  </div>
  <div class="gmail_quote">On Fri, Feb 12, 2010 at 12:39 PM, Beno&icirc;t
Andrieu <span dir="ltr">&lt;<a moz-do-not-send="true"
 href="mailto:bea@ixsea.com">bea@ixsea.com</a>&gt;</span> wrote:<br>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
    <div text="#000000" bgcolor="#ffffff">Dear Carlos,<br>
    <br>
Yes, you should open a FWTools shell or set the FWTools path in your
PATH environment variable.<br>
And yes, the command line should be executed in the directory where
your images are but you can easily customize his behaviour :<br>
    <br>
    <blockquote><tt>mkdir __your_path__\converted<br>
FOR %%g in (</tt><tt>__your_path__</tt><tt>\*.tif) do gdal_translate
-of JPEG "</tt><tt>__your_path__</tt><tt>\</tt><tt>%%nxg" "</tt><tt>__your_path__\</tt><tt>converted\%%ng.jpg"<br>
      </tt></blockquote>
The first line will create a new folder in your folder.<br>
    <tt><br>
FOR %%g in (</tt><tt>__your_path__</tt><tt>*.tif) &nbsp;&nbsp; ===&gt;</tt> This
will select all the files in your directory and iterate with the %%g
variable<br>
    <tt>"%%nxg"&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ===&gt;</tt> n = name of the
file without its extension, x = extension of the file, g = the name of
the variable<br>
    <tt>"%%ng.jpg" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ===&gt; </tt>This will
change the extension of the file<br>
    <br>
Regarding the binary format, could you tell me more about the file you
sent ?<br>
I would need its width, height, number of bands (gray, RGB, ARGB ?) and
the data type of each pixel (Byte, Int16, Float32 ?).<br>
Thanks.<br>
I would use the GenBin format too but unfortunately, GDAL is only able
to read them...<br>
    <br>
    <b><u>To the list :</u></b><br>
You can find the file sent by Carlos at this address<br>
    <a moz-do-not-send="true"
 href="http://benoit.andrieu.free.fr/00046agua.zip" target="_blank">http://benoit.andrieu.free.fr/00046agua.zip</a><br>
    <br>
Best regards,<br>
Beno&icirc;t Andrieu<br>
    <br>
    <br>
    <tt><br>
    </tt>Le 12/02/2010 13:06, Carlos Padovani a &eacute;crit&nbsp;:
    <div>
    <div class="h5">
    <blockquote type="cite">
      <div>Dear Beno&icirc;t,</div>
      <div>thanks very much for your fast response.</div>
      <div>I am not familiar with&nbsp;command line procedures, so could you
explain in more details&nbsp;what should I do for to convert the tif images
to other format?</div>
      <div>I will use this command line in the FWTools Shell? I need to
wrote this command line&nbsp;in a directory where the images are?&nbsp;<br>
I took a look in the <a moz-do-not-send="true"
 href="http://www.gdal.org/formats_list.html" target="_blank">http://www.gdal.org/formats_list.html</a>&nbsp;and
I guess that the binary files I need to convert from tif are the
Generic Binary (GenBin). </div>
      <div>I am sending an image file for you to take a look&nbsp;if
you&nbsp;agree&nbsp;and maybe help me to identify if it is the same Generic
Binary of gdal format list.</div>
      <div>Thanks once more.</div>
      <div>Carlos<br>
      </div>
      <div class="gmail_quote">On Fri, Feb 12, 2010 at 10:04 AM, Beno&icirc;t
Andrieu <span dir="ltr">&lt;<a moz-do-not-send="true"
 href="mailto:bea@ixsea.com" target="_blank">bea@ixsea.com</a>&gt;</span>
wrote:<br>
      <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
        <div text="#000000" bgcolor="#ffffff">I don't know about binary
formats but you should find what you want here : <a
 moz-do-not-send="true" href="http://www.gdal.org/formats_list.html"
 target="_blank">http://www.gdal.org/formats_list.html</a><br>
        <br>
        <br>
You can use a bat file to convert all files from a folder :<br>
        <blockquote><tt>mkdir converted<br>
FOR %%g in (*.tif) do gdal_translate -of JPEG "%%nxg"
"converted\%%ng.jpg"<br>
          </tt></blockquote>
        <br>
Regards,<br>
Beno&icirc;t Andrieu<br>
        <br>
        <br>
        <br>
Le 12/02/2010 11:00, Carlos Padovani a &eacute;crit&nbsp;:
        <blockquote type="cite">
          <div>
          <div>Dear users of FWTools,<br>
I need to convert a lot of images form TIFF format to binary format. <br>
It is possible to do it in FWTools, but I do not know which is the
format available in the software that correspond to binary format.
Another thing is that in FWTools I can convert the images one by one,
and as I have a lot of images to convert,&nbsp;I would like a way to convert
a lot of images at once. I use Windows WP as operacional system.<br>
Could someone help me?<br>
Thanks in advance. <br clear="all">
Carlos </div>
          </div>
          <pre><fieldset></fieldset>
_______________________________________________
FWTools mailing list
<a moz-do-not-send="true" href="mailto:FWTools@lists.maptools.org"
 target="_blank">FWTools@lists.maptools.org</a>
<a moz-do-not-send="true"
 href="http://lists.maptools.org/mailman/listinfo/fwtools"
 target="_blank">http://lists.maptools.org/mailman/listinfo/fwtools</a>
<a moz-do-not-send="true" href="http://fwtools.maptools.org/"
 target="_blank">http://fwtools.maptools.org/</a>
  </pre>
        </blockquote>
        </div>
        <br>
_______________________________________________<br>
FWTools mailing list<br>
        <a moz-do-not-send="true"
 href="mailto:FWTools@lists.maptools.org" target="_blank">FWTools@lists.maptools.org</a><br>
        <a moz-do-not-send="true"
 href="http://lists.maptools.org/mailman/listinfo/fwtools"
 target="_blank">http://lists.maptools.org/mailman/listinfo/fwtools</a><br>
        <a moz-do-not-send="true" href="http://fwtools.maptools.org/"
 target="_blank">http://fwtools.maptools.org/</a><br>
        <br>
      </blockquote>
      </div>
      <br>
      <br clear="all">
      <br>
-- <br>
Carlos Padovani<br>
Pesquisador<br>
Embrapa Pantanal<br>
      <a moz-do-not-send="true" href="http://www.cpap.embrapa.br/"
 target="_blank">www.cpap.embrapa.br</a><br>
SKYPE: carlos.padovani<br>
      <a moz-do-not-send="true"
 href="mailto:MSN%3Acrpadovani@hotmail.com" target="_blank">MSN:crpadovani@hotmail.com</a><br>
      <br>
      <br>
    </blockquote>
    </div>
    </div>
    </div>
  </blockquote>
  </div>
  <br>
  <br clear="all">
  <br>
-- <br>
Carlos Padovani<br>
Pesquisador<br>
Embrapa Pantanal<br>
  <a moz-do-not-send="true" href="http://www.cpap.embrapa.br">www.cpap.embrapa.br</a><br>
SKYPE: carlos.padovani<br>
  <a moz-do-not-send="true" href="mailto:MSN%3Acrpadovani@hotmail.com">MSN:crpadovani@hotmail.com</a><br>
  <br>
  <br>
</blockquote>
</body>
</html>