Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tif driver create() does not honor WEBP_LEVEL or WEBP_LOSSLESS #1594

Closed
tbonfort opened this issue May 28, 2019 · 0 comments
Closed

tif driver create() does not honor WEBP_LEVEL or WEBP_LOSSLESS #1594

tbonfort opened this issue May 28, 2019 · 0 comments

Comments

@tbonfort
Copy link
Member

#include <gdal.h>
#include <gdal_utils.h>

int main(int argc, char **argv) {
	GDALAllRegister();
	GDALDriverH tif = GDALGetDriverByName("GTIFF");
	char **opts=calloc(5,sizeof(char*));
	opts[0]="WEBP_LEVEL=95";
	opts[1]="TILED=YES";
	opts[2]="COMPRESS=WEBP";
	opts[3]="BIGTIFF=YES";
	GDALDatasetH ds = GDALCreate(tif,"foo.tif",1024,1024,4,GDT_Byte,opts);
	char *buf=malloc(1024*1024*4);
	for(int i=0;i<1024;i++) {
		for(int j=0;j<1024;j+=4) {
			char *pix = buf+i*1024+j;
			pix[0]=i;
			pix[1]=i;
			pix[2]=i;
			pix[3]=255;
		}
	}
	GDALDatasetRasterIO(ds,GF_Write,0,0,1024,1024,buf,1024,1024,GDT_Byte,4,NULL,4,1024*4,1);
	GDALClose(ds);
}

Running this code after changing the value of WEBP_LEVEL will result in an indentical file being created, i.e. WEBP_LEVEL is ignored.

rouault added a commit that referenced this issue May 29, 2019
rouault added a commit that referenced this issue May 29, 2019
rouault added a commit that referenced this issue May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant