[gdal-dev] JPEG format.
Belaid MOA
belaid_moa at hotmail.com
Wed Jul 29 14:42:17 EDT 2009
Special thanks Even. You are always quick and to the point! Thank you very much.
As you pointed out, I was handling JPEG in the same manner as GTiff; I did not use the MEM driver first.
With best regards.
~Belaid.
> From: even.rouault at mines-paris.org
> To: gdal-dev at lists.osgeo.org
> Subject: Re: [gdal-dev] JPEG format.
> Date: Wed, 29 Jul 2009 19:55:46 +0200
> CC: belaid_moa at hotmail.com
>
> Le Wednesday 29 July 2009 19:44:41 Belaid MOA, vous avez écrit :
> > Hi Everyone,
> > When I try to use GDALCreate() on the JPEG driver, I got the following
> > error: "GDALDriver::Create() ... no create method implemented for this
> > format." Does is this mean that JPEG driver does not have its GDALCreate()
> > function implemented?
>
> Hum, I can admit that sometimes error messages are not particularly clear, but
> here .... !
>
> > Any example on how to use JPEG driver is appreciated.
>
> The JPEG is no different from other drivers. The fact that the Create() method
> is not implemented just reflect the fact that you can't write data at random
> scanlines in a JPEG file, it must be created scanline by scanline, from top
> to bottom. So you want to use the CreateCopy() method instead. As a source
> raster for the CreateCopy(), you can use a dataset created with the MEM
> driver (that supports the Create() method), or any other disk-based format
> like GTIFF that supports the Create() method.
>
> Schematically (in Python) :
>
> mem_ds = gdal.GetDriverByName('MEM').Create(....)
> mem_ds.WriteRaster(....)
>
> jpeg_ds = gdal.GetDriverByName('JPEG').CreateCopy(mem_ds, "out.jpg")
> jpeg_ds = None
> mem_ds = None
>
> >
> > As always, any help on this is very appreciated.
> >
> > With best regards.
> > ~Belaid
> >
> > _________________________________________________________________
> > Stay in the loop and chat with friends, right from your inbox!
> > http://go.microsoft.com/?linkid=9671354
>
>
More storage. Better anti-spam and antivirus protection. Hotmail makes it simple.
_________________________________________________________________
Send and receive email from all of your webmail accounts.
http://go.microsoft.com/?linkid=9671356
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20090729/183ebef2/attachment-0001.html
More information about the gdal-dev
mailing list