[Gdal-dev] GDALCreate with JPEG

Luis W. Sevilla sevilla_lui at gva.es
Sat Dec 3 04:15:35 EST 2005


Hi Frank,
as you maybe know allready I'm working with Nacho on this,
Frank Warmerdam wrote:

>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.
>  
>
We gessed that it works on that way,

>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.
>  
>
As this will be on the bottom of gvSIG 'save to raster' tool, by 
definition we've
no limit about the size of the raster. Someone may want to save an image of
30000x20000 px if it makes sense for him. Seing that jpeg seemed to work 
only
with CreateCopy() (as you've confirmed right now) we thinked on write a
indirect saver, using a temporary files (raw). If img it's best suited 
for this will
use this format.

Thanks for your always valuable support

-- 
  Luis W. Sevilla
  Responsable de desarrollo gvSIG en la / gvSIG development Chief at
  Conselleria de Infraestructuras y Transporte
  Generalitat Valenciana
  Valencia - Spain
  http://www.gvsig.gva.es




More information about the Gdal-dev mailing list