[Gdal-dev] GDALCreate with JPEG
Frank Warmerdam
warmerdam at pobox.com
Fri Dec 2 23:25:26 EST 2005
On 12/2/05, Nacho Brodin <brodin_ign at gva.es> wrote:
> Hello,
> I'm having problems with the function GDALCreate using the JPEG driver however
> GDALCreateCopy works correctly, I can create jpg images with this function.
> With GTiff driver GDALCreate works well.
> The error message that GDALCreate show is
> ERROR 6: GDALDriver::Create() ... no create method implemented for this
> format.
> If I execute "gdal_translate --help" it shows the driver list with output
> support and this list includes JPEG format.
>
> I think that this is a JPEG driver normal behavior but I am not just exporting
> an existing file to a new jpg file. Any suggestion?
Nacho,
Unfortunately for many formats it is difficult to support the
Create() method because the formats have pretty strict
rules about the order things are written and it is hard to
enforce that when the Create() method is used.
Those formats are sometimes referred to as CreateCopy()
only formats, and they include JPEG. For these formats, you
can only create them with GDALCreateCopy(), meaning you need
some sort of input image even if it is a memory data, or a
virtual file. For modest sized images, I would suggest you
just go through the Create() process using the MEM driver
(all in memory), and then do a CreateCopy() to JPEG from
that.
For big images either create a temporary file (in TIFF or
.img format for instance) or look into creating a virtual file
allowing you to provide the image data as it is requested by
the driver. The virtual method is the most complex option.
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
More information about the Gdal-dev
mailing list