summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'devices/gdevtifs.c')
-rw-r--r--devices/gdevtifs.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/devices/gdevtifs.c b/devices/gdevtifs.c
index 9c629afa..55ae5a7d 100644
--- a/devices/gdevtifs.c
+++ b/devices/gdevtifs.c
@@ -149,7 +149,7 @@ tiff_put_some_params(gx_device * dev, gs_param_list * plist, int which)
bool big_endian = tfdev->BigEndian;
bool usebigtiff = tfdev->UseBigTIFF;
bool write_datetime = tfdev->write_datetime;
- uint16 compr = tfdev->Compression;
+ uint16_t compr = tfdev->Compression;
gs_param_string comprstr;
long mss = tfdev->MaxStripSize;
long aw = tfdev->AdjustWidth;
@@ -325,11 +325,16 @@ int tiff_set_compression(gx_device_printer *pdev,
TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, pdev->height);
}
else {
- int rows = max_strip_size /
+ int rows = 0;
+
+ if (pdev->width >=1) {
+ rows = max_strip_size /
gdev_mem_bytes_per_scan_line((gx_device *)pdev);
- TIFFSetField(tif,
+ TIFFSetField(tif,
TIFFTAG_ROWSPERSTRIP,
TIFFDefaultStripSize(tif, max(1, rows)));
+ } else
+ return_error(gs_error_rangecheck);
}
return 0;
@@ -355,6 +360,7 @@ int tiff_set_fields_for_printer(gx_device_printer *pdev,
TIFFSetField(tif, TIFFTAG_XRESOLUTION, (float)xpi);
TIFFSetField(tif, TIFFTAG_YRESOLUTION, (float)ypi);
+#ifndef CLUSTER
{
char revs[32];
#define maxSoftware 40
@@ -372,6 +378,7 @@ int tiff_set_fields_for_printer(gx_device_printer *pdev,
TIFFSetField(tif, TIFFTAG_SOFTWARE, softwareValue);
}
+#endif
if (writedatetime) {
struct tm tms;
time_t t;
@@ -458,7 +465,7 @@ tiff_print_page(gx_device_printer *dev, TIFF *tif, int min_feature_size)
if (row - line_lag >= 0) {
#if defined(ARCH_IS_BIG_ENDIAN) && (!ARCH_IS_BIG_ENDIAN)
if (bpc == 16)
- TIFFSwabArrayOfShort((uint16 *)data,
+ TIFFSwabArrayOfShort((uint16_t *)data,
dev->width * (long)dev->color_info.num_components);
#endif
@@ -565,7 +572,7 @@ tiff_downscale_and_print_page(gx_device_printer *dev, TIFF *tif,
static struct compression_string {
- uint16 id;
+ uint16_t id;
const char *str;
} compression_strings [] = {
{ COMPRESSION_NONE, "none" },
@@ -579,7 +586,7 @@ static struct compression_string {
};
int
-tiff_compression_param_string(gs_param_string *param, uint16 id)
+tiff_compression_param_string(gs_param_string *param, uint16_t id)
{
struct compression_string *c;
for (c = compression_strings; c->str; c++)
@@ -591,7 +598,7 @@ tiff_compression_param_string(gs_param_string *param, uint16 id)
}
int
-tiff_compression_id(uint16 *id, gs_param_string *param)
+tiff_compression_id(uint16_t *id, gs_param_string *param)
{
struct compression_string *c;
for (c = compression_strings; c->str; c++)
@@ -604,7 +611,7 @@ tiff_compression_id(uint16 *id, gs_param_string *param)
return_error(gs_error_undefined);
}
-int tiff_compression_allowed(uint16 compression, byte depth)
+int tiff_compression_allowed(uint16_t compression, byte depth)
{
return ((depth == 1 && (compression == COMPRESSION_NONE ||
compression == COMPRESSION_CCITTRLE ||