Skip Menu |
 

This queue is for tickets about the Imager CPAN distribution.

Report information
The Basics
Id: 29771
Status: resolved
Priority: 20/
Queue: Imager

People
Owner: TONYC [...] cpan.org
Requestors: nikita.dedik [...] bulyon.com
TONYC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.60
Fixed in: (no value)



Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 689614D81D5 for <bug-Imager [...] rt.cpan.org>; Thu, 4 Oct 2007 10:21:58 -0400 (EDT)
Received: (qmail 3163 invoked by alias); 4 Oct 2007 14:21:58 -0000
Received: from smtp.syd.people.net.au (HELO smtp.syd.people.net.au) (218.214.225.98) by la.mx.develooper.com (qpsmtpd/0.28) with SMTP; Thu, 04 Oct 2007 07:21:53 -0700
Received: (qmail 27106 invoked from network); 4 Oct 2007 14:22:06 -0000
Received: from unknown (HELO develop-help.com) (202.154.105.237) by smtp.syd.people.net.au with SMTP; 4 Oct 2007 14:22:06 -0000
Received: from develop-help.com (tony [...] localhost [127.0.0.1]) by develop-help.com (8.13.8/8.13.8/Debian-3) with ESMTP id l94ELlCI015283 for <bug-Imager [...] rt.cpan.org>; Fri, 5 Oct 2007 00:21:47 +1000
Received: (from tony [...] localhost) by develop-help.com (8.13.8/8.13.8/Submit) id l94ELkwE015282 for bug-Imager [...] rt.cpan.org; Fri, 5 Oct 2007 00:21:46 +1000
Delivered-To: cpan-bug+imager [...] diesel.bestpractical.com
User-Agent: Mutt/1.5.13 (2006-08-11)
MIME-Version: 1.0
Subject: Imager::Font::Wrap doesn't count the last line length
X-Spam-Status: No, hits=-2.6 required=8.0 tests=BAYES_00,SPF_PASS
Return-Path: <tony [...] develop-help.com>
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: bug-Imager [...] rt.cpan.org
Content-Disposition: inline
Date: Fri, 5 Oct 2007 00:21:46 +1000
Message-Id: <20071004142146.GC11149 [...] develop-help.com>
content-type: text/plain; charset="utf-8"
To: bug-Imager [...] rt.cpan.org
From: tonyc [...] cpan.org
X-RT-Original-Encoding: us-ascii
Content-Length: 1072
(Other's email addresses obscured) ----- Forwarded message from "Eleneldil G. Arilou" <eleneldil@xxxx> ----- X-Spam-Checker-Version: SpamAssassin 3.1.7-deb (2006-10-05) on develop-help.com X-Spam-Level: Date: Thu, 4 Oct 2007 18:04:32 +0400 (MSD) From: "Eleneldil G. Arilou" <eleneldil@xxxx> To: tony@develop-help.com Subject: Imager::Font::Wrap doesn't count the last line length Hi! When I supply the savepos parameter to the wrap_text methot, the value it saves in the specified scalar really is the total count of characters drawn except of the last line part. I think the problem is here: if (length $line && !$state{full}) { _format_line(\%state, 0, $line, 0); } if ($input{savepos}) { ${$input{savepos}} = $linepos; } The length of the trailing $line was not counted in the $linepos before and it not here too. ---------------- ------------------ With best regards, ? ?????????? ???????????, Eleneldil G. Arilou ??????????? ?. ?????? (Danil Lavrentyuk) (????? ?????????) eleneldil@xxxx; ... Show quoted text
----- End forwarded message -----
Subject: Imager::Font::Wrap doesn't correctly set savepos
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Type: text/plain; charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 643
Download (untitled) / with headers
text/plain 643b
When I supply the savepos parameter to the wrap_text method, the value it saves in the specified scalar really is the total count of characters drawn *except* the last line. I think the problem is here: if (length $line && !$state{full}) { _format_line(\%state, 0, $line, 0); } if ($input{savepos}) { ${$input{savepos}} = $linepos; } The length of the trailing $line is not taken into account! The corrected code looks like this: if (length $line && !$state{full}) { $linepos += length $line if _format_line(\%state, 0, $line, 0); } if ($input{savepos}) { ${$input{savepos}} = $linepos; } Thanks!!
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.6.HEAD-29626-1191510066-706.29771-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 355
Download (untitled) / with headers
text/plain 355b
On Thu Oct 04 10:30:03 2007, nikita.dedik@bulyon.com wrote: Show quoted text
> The corrected code looks like this: > > if (length $line && !$state{full}) { > $linepos += length $line > if _format_line(\%state, 0, $line, 0); > } > if ($input{savepos}) { > ${$input{savepos}} = $linepos; > }
Thanks for that, I plan to have this fixed for 0.61. Tony
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-29626-1191510066-706.29771-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
References: <rt-3.6.HEAD-29626-1191510066-706.29771-0-0 [...] rt.cpan.org>
Message-Id: <rt-3.6.HEAD-29606-1191517016-297.29771-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
From: nikita.dedik [...] bulyon.com
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 71
Tony, thanks a lot! And for the whole deal with Imager!! It's awesome!
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.6.HEAD-14430-1194250338-1129.29771-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 611
Download (untitled) / with headers
text/plain 611b
On Thu Oct 04 10:30:03 2007, nikita.dedik@bulyon.com wrote: Show quoted text
> When I supply the savepos parameter to the wrap_text method, the value > it saves in the specified scalar really is the total count of > characters drawn *except* the last line. > > I think the problem is here: > > if (length $line && !$state{full}) { > _format_line(\%state, 0, $line, 0); > } > if ($input{savepos}) { > ${$input{savepos}} = $linepos; > } > > The length of the trailing $line is not taken into account!
Hi, This problem is fixed in Imager 0.61, which I've just released to CPAN. Thanks for your report. Tony
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-14430-1194250338-1129.29771-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
References: <rt-3.6.HEAD-14430-1194250338-1129.29771-0-0 [...] rt.cpan.org>
Message-Id: <rt-3.6.HEAD-14408-1194335240-1156.29771-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
From: nikita.dedik [...] bulyon.com
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 14
Thanks a lot!!


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.