Return-Path: <awaresystems.be+caf_=filtered=awaresystems.be@gmail.com>
Delivered-To: filtered@awaresystems.be
Received: from mx02.one.com (mx02.one.com [195.47.247.73])
	by mail6.local.one.com (Postfix) with ESMTP id A763E300310A11
	for <filtered@awaresystems.be>; Tue, 23 Dec 2014 16:06:50 +0000 (UTC)
X-Virus-Scanned: by one.com
Received-SPF: pass (mx02: domain of awaresystems.be+caf_=filtered=awaresystems.be@gmail.com designates 209.85.217.182 as permitted sender)
X-Greylist: whitelisted by SQLgrey-1.8.0-rc2
Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182])
	by mx02.one.com (Postfix) with ESMTP id 646D9DD6994
	for <filtered@awaresystems.be>; Tue, 23 Dec 2014 16:06:50 +0000 (UTC)
Received: by mail-lb0-f182.google.com with SMTP id f15so6168165lbj.27
        for <filtered@awaresystems.be>; Tue, 23 Dec 2014 08:06:49 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-original-authentication-results:delivered-to:delivered-to
         :message-id:date:from:user-agent:mime-version:to:references
         :in-reply-to:subject:precedence:list-id:list-unsubscribe
         :list-archive:list-post:list-help:list-subscribe:content-type
         :content-transfer-encoding:sender:errors-to;
        bh=0Jm7dzibSJYHtezbR39qEXFovFVqbFNa6Br61DCwdcY=;
        b=jOIY3NogmnwVqjPoi87xAZTkJcfslWmPMiohoCA+4tlFF8wpowtVUuAA1d5BUjBgrv
         VMnJ22p4k+KoXcaSVHjMeqoOD1nE+pYj2A4MJDaNWacDqdNwt1LiLCczVIpv8+nj8Hrs
         mRGoVXhMxDRB7RxZ5ZQYddJPVEsNOiZDVMG8y2eT9Rrs/BR3Oy3WXqb8fIIwTxf5i5ax
         7guqzDU5l8O1Wx+1sJwZe4hFaG1ply5v8hPKva0nRF0DhM6ptmPO2uO/6cjB2eKmWSEp
         TGhtXVpjW9y9SYrgCx/f3ayvGSM6Jgb8T9q9DoJIkFIPbGq5cpbe1sXcwX/5ZgHB3mWq
         m+SQ==
X-Original-Authentication-Results: mx.google.com;       spf=none (google.com: tiff-bounces@lists.maptools.org does not designate permitted sender hosts) smtp.mail=tiff-bounces@lists.maptools.org
X-Received: by 10.152.206.108 with SMTP id ln12mr28806944lac.3.1419350809453;
        Tue, 23 Dec 2014 08:06:49 -0800 (PST)
X-Forwarded-To: filtered@awaresystems.be
X-Forwarded-For: awaresystems.be@gmail.com filtered@awaresystems.be
Delivered-To: awaresystems.be@gmail.com
Received: by 10.114.181.147 with SMTP id dw19csp603284ldc;
        Tue, 23 Dec 2014 08:06:48 -0800 (PST)
X-Received: by 10.112.198.1 with SMTP id iy1mr28556629lbc.13.1419350808387;
        Tue, 23 Dec 2014 08:06:48 -0800 (PST)
Authentication-Results: mx.google.com;
       spf=none (google.com: tiff-bounces@lists.maptools.org does not designate permitted sender hosts) smtp.mail=tiff-bounces@lists.maptools.org
Received-SPF: none (google.com: tiff-bounces@lists.maptools.org does not designate permitted sender hosts) client-ip=195.47.247.73;
Received: by 10.112.74.9 with POP3 id p9mf7013860lbv.15;
        Tue, 23 Dec 2014 08:06:47 -0800 (PST)
X-Gmail-Fetch-Info: info@awaresystems.be 1 pop.awaresystems.be 110 info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx02.one.com (mx02.one.com [195.47.247.73])
	by mail6.local.one.com (Postfix) with ESMTP id 56819300302E1E
	for <info@awaresystems.be>; Tue, 23 Dec 2014 15:44:32 +0000 (UTC)
X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0-rc2
Received: from lists.maptools.org (ks365428.kimsufi.com [94.23.4.142])
	by mx02.one.com (Postfix) with ESMTP id 28C93DC8D24
	for <info@awaresystems.be>; Tue, 23 Dec 2014 15:44:31 +0000 (UTC)
Received: from [10.1.0.241] (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id 478F435C06B;
	Tue, 23 Dec 2014 10:43:15 -0500 (EST)
Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com
	[209.85.217.178])
	by lists.maptools.org (Postfix) with ESMTPS id A141535C025
	for <tiff@lists.maptools.org>; Tue, 23 Dec 2014 10:42:36 -0500 (EST)
Received: by mail-lb0-f178.google.com with SMTP id f15so6076565lbj.23
	for <tiff@lists.maptools.org>; Tue, 23 Dec 2014 07:42:43 -0800 (PST)
X-Received: by 10.112.84.225 with SMTP id c1mr7374306lbz.22.1419349363395;
	Tue, 23 Dec 2014 07:42:43 -0800 (PST)
Received: from ?IPv6:2a00:1370:8000:eff::3c6b? ([2a00:1370:8000:eff::3c6b])
	by mx.google.com with ESMTPSA id kt7sm5955292lac.4.2014.12.23.07.42.42
	for <tiff@lists.maptools.org>
	(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Tue, 23 Dec 2014 07:42:42 -0800 (PST)
Message-ID: <54998D71.2020607@gmail.com>
Date: Tue, 23 Dec 2014 18:42:41 +0300
From: "Yuriy M. Kaminskiy" <yumkam@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: tiff@lists.maptools.org
References: <alpine.GSO.2.01.1412222059070.18732@freddy.simplesystems.org>
In-Reply-To: <alpine.GSO.2.01.1412222059070.18732@freddy.simplesystems.org>
Subject: Re: [Tiff] TIFF JBIG writer and scanlines
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

Bob Friesenhahn wrote:
> Today I encountered this:
> 
> % tiffcp -r -1 -c jbig golfer-150-bilevel.tiff golfer-150-bilevel-jbig.tiff
> golfer-150-bilevel-jbig.tiff: ISO JBIG scanline encoding is not implemented.
> golfer-150-bilevel-jbig.tiff: Error, can't write scanline 0.
> 
> This was due to a GraphicsMagick user reporting that scanline reading 
> sometimes fails due to libtiff's JBIG support reporting that reading 
> via scanlines is not supported.  I used the tiffcp incantation he 
> provided and encountered the same error as when GraphicsMagick tries 
> to write via its scanline writer.
> 
> This is using jbigkit-2.0.  I tried on a machine with jbigkit-1.6 and 
> it worked.
> 
> Ideas?

Apparently, it fails when source has more than one strip.
Working:
  Image Width: 1100 Image Length: 1600
  Rows/Strip: 1600
Failing:
  Image Width: 1100 Image Length: 1600
  Rows/Strip: 256
Conversion in two steps works:
tiffcp -r -1 in.tiff temp.tiff # convert to single strip
tiffcp -c jbig temp.tiff out.tiff # compress to jbig

Relevant code from tiffcp.c:
	case pack(PLANARCONFIG_CONTIG,   PLANARCONFIG_CONTIG,   F,F,F):
		return bias ? cpBiasedContig2Contig : cpContig2ContigByRow;
// ^^^ used when changing stripe size (and fails with jbig)
	case pack(PLANARCONFIG_CONTIG,   PLANARCONFIG_CONTIG,   F,F,T):
		return cpDecodedStrips;
// ^^^ used when recompressing same strip size (works with jbig)
_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
