int imagetotga(opj_image_t * image, const char *outfile) {
int width, height, bpp, x, y;
OPJ_BOOL write_alpha;
- int i, adjustR, adjustG, adjustB, fails;
+ unsigned int i;
+ int adjustR, adjustG, adjustB, fails;
unsigned int alpha_channel;
float r,g,b,a;
unsigned char value;
/* set image offset and reference grid */
image->x0 = parameters->image_offset_x0;
image->y0 = parameters->image_offset_y0;
- image->x1 = !image->x0 ? (w - 1) * subsampling_dx + 1 : image->x0 + (w - 1) * subsampling_dx + 1;
- image->y1 = !image->y0 ? (h - 1) * subsampling_dy + 1 : image->y0 + (h - 1) * subsampling_dy + 1;
+ image->x1 = !image->x0 ? (w - 1) * subsampling_dx + 1 : (int)(image->x0 + (w - 1) * subsampling_dx + 1);
+ image->y1 = !image->y0 ? (h - 1) * subsampling_dy + 1 : (int)(image->y0 + (h - 1) * subsampling_dy + 1);
/* set image data */
/* set image offset and reference grid */
image->x0 = parameters->image_offset_x0;
image->y0 = parameters->image_offset_y0;
- image->x1 = !image->x0 ? (w - 1) * subsampling_dx + 1 : image->x0 + (w - 1) * subsampling_dx + 1;
- image->y1 = !image->y0 ? (h - 1) * subsampling_dy + 1 : image->y0 + (h - 1) * subsampling_dy + 1;
+ image->x1 = !image->x0 ? (w - 1) * subsampling_dx + 1 : (int)(image->x0 + (w - 1) * subsampling_dx + 1);
+ image->y1 = !image->y0 ? (h - 1) * subsampling_dy + 1 : (int)(image->y0 + (h - 1) * subsampling_dy + 1);
/* set image data */
/* set image offset and reference grid */
image->x0 = parameters->image_offset_x0;
image->y0 = parameters->image_offset_y0;
- image->x1 = !image->x0 ? (w - 1) * subsampling_dx + 1 : image->x0 + (w
- - 1) * subsampling_dx + 1;
- image->y1 = !image->y0 ? (h - 1) * subsampling_dy + 1 : image->y0 + (h
- - 1) * subsampling_dy + 1;
+ image->x1 = !image->x0 ? (w - 1) * subsampling_dx + 1 : (int)(image->x0 + (w - 1) * subsampling_dx + 1);
+ image->y1 = !image->y0 ? (h - 1) * subsampling_dy + 1 : (int)(image->y0 + (h - 1) * subsampling_dy + 1);
/* set image data */
cmptparm.x0 = parameters->image_offset_x0;
cmptparm.y0 = parameters->image_offset_y0;
- cmptparm.w = !cmptparm.x0 ? (w - 1) * parameters->subsampling_dx + 1 : cmptparm.x0 + (w - 1) * parameters->subsampling_dx + 1;
- cmptparm.h = !cmptparm.y0 ? (h - 1) * parameters->subsampling_dy + 1 : cmptparm.y0 + (h - 1) * parameters->subsampling_dy + 1;
+ cmptparm.w = !cmptparm.x0 ? (w - 1) * parameters->subsampling_dx + 1 : (int)(cmptparm.x0 + (w - 1) * parameters->subsampling_dx + 1);
+ cmptparm.h = !cmptparm.y0 ? (h - 1) * parameters->subsampling_dy + 1 : (int)(cmptparm.y0 + (h - 1) * parameters->subsampling_dy + 1);
if (sign == '-') {
cmptparm.sgnd = 1;
int imagetopgx(opj_image_t * image, const char *outfile)
{
int w, h;
- int i, j, compno, fails = 1;
+ int i, j, fails = 1;
+ unsigned int compno;
FILE *fdest = NULL;
for (compno = 0; compno < image->numcomps; compno++)
{
int *red, *green, *blue, *alpha;
int wr, hr, max;
- int i, compno, ncomp;
+ int i;
+ unsigned int compno, ncomp;
int adjustR, adjustG, adjustB, adjustA;
int fails, two, want_gray, has_alpha, triple;
int prec, v;
image->x0 = parameters->image_offset_x0;
image->y0 = parameters->image_offset_y0;
image->x1 = !image->x0 ? (w - 1) * subsampling_dx + 1 :
- image->x0 + (w - 1) * subsampling_dx + 1;
+ (int)(image->x0 + (w - 1) * subsampling_dx + 1);
image->y1 = !image->y0 ? (h - 1) * subsampling_dy + 1 :
- image->y0 + (h - 1) * subsampling_dy + 1;
+ (int)(image->y0 + (h - 1) * subsampling_dy + 1);
buf = _TIFFmalloc(TIFFStripSize(tif));
image->x0 = parameters->image_offset_x0;
image->y0 = parameters->image_offset_y0;
image->x1 = !image->x0 ? (w - 1) * subsampling_dx + 1 :
- image->x0 + (w - 1) * subsampling_dx + 1;
+ (int)(image->x0 + (w - 1) * subsampling_dx + 1);
image->y1 = !image->y0 ? (h - 1) * subsampling_dy + 1 :
- image->y0 + (h - 1) * subsampling_dy + 1;
+ (int)(image->y0 + (h - 1) * subsampling_dy + 1);
buf = _TIFFmalloc(TIFFStripSize(tif));
{
FILE *rawFile = NULL;
size_t res;
- int compno;
+ unsigned int compno;
int w, h, fails;
int line, row, curr, mask;
int *ptr;