ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: error when using externalfigure
       [not found] <mailman.384.1353926481.2161.ntg-context@ntg.nl>
@ 2012-11-26 11:21 ` Robert Blackstone
  0 siblings, 0 replies; 14+ messages in thread
From: Robert Blackstone @ 2012-11-26 11:21 UTC (permalink / raw)
  To: ntg-context


On 26 Nov 2012, at 11:41 , Pavel Dohnal <pavel.dohnal@twobits.cz> , wrote:
> When I try this particural image
> convert it gives me this image:
> http://cdn-images-squared.tripomatic.com/e46c68903d2c4445f05a0369578c17dd-270.jpg
> But after context runs this file it falls down with error message:


I have no idea what you are trying to make, but if you can see the picture on your screen and you make a screenshot, ConTeXt will process that without a problem. The problem is perhaps that its resolution is a bit low so that you are limited as far as its size of the picture is concerned. But 4x4 cm would give an acceptable result, I think. (I tested it and the result is quite OK.)

Best regards,

Robert Blackstone


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: error when using externalfigure
  2012-11-26 19:54     ` Dr. Hartmut Henkel
@ 2012-11-26 20:42       ` Hans Hagen
  0 siblings, 0 replies; 14+ messages in thread
From: Hans Hagen @ 2012-11-26 20:42 UTC (permalink / raw)
  To: Dr. Hartmut Henkel; +Cc: mailing list for ConTeXt users

On 11/26/2012 8:54 PM, Dr. Hartmut Henkel wrote:
> On Mon, 26 Nov 2012, Hans Hagen wrote:
>> On 11/26/2012 10:36 AM, luigi scarso wrote:
>>> On Mon, Nov 26, 2012 at 10:20 AM, Pavel Dohnal <pavel.dohnal@twobits.cz>
>>> wrote:
>>>> I have a big context source file which contains pictures from different
>>>> sources. The problem is, that there are some pictures the context cannot
>>>> process. It displays an error message and ends. I run the context from
>>>> another script in batchmode. After finishing, the context creates a PDF
>>>> file, which contains this problematic picture but the pdf is broken. It
>>>> does
>>>> not have numbers in the table of contents and it is not arranged by setup.
>>>> Here is a minimal example:
>>>> \starttext
>>>> \externalfigure[http://cdn-locations-images.tripomatic.com/img-poi1295-5ZTynx-s.jpg][width=26.5mm]
>>>> \stoptext
>
> i just tried the minimal example here, it gives a valid PDF with a
> properly (afaics) scaled image.
>
> Creator:        ConTeXt - 2012.11.26 13:31
> Producer:       LuaTeX-0.70.2
>
>>> when I save the jpg  as eps from gimp
>>> I see
>>> width = 6096,00
>>> height=4064,00
>
> tried, can't see here.
>
>>> The first value is off for TeX.
>>
>> if i print the values from the img object i get
>>
>> 17344.8pt
>> 11563.2pt
>>
>> so the problem is deep down in the jpg reader ... the image is crippled in the
>> sense that it has no valid resolution information
>>
>> something for hartmut to check in the img lib
>
> can't confirm. Is this solved already?

the latest beta clips ... something:

local maxdimen = 2^30-1

function img.check(figure)
     if figure then
         local width = figure.width
         local height = figure.height
         if height > width then
             if height > maxdimen then
                 figure.height = maxdimen
                 figure.width  = width * maxdimen/height
             end
         elseif width > maxdimen then
             figure.width  = maxdimen
             figure.height = height * maxdimen/width
         end
         return figure
     end
end

so it's taken care of (in principle the img library is right in handling 
 > maxdimen dimensions as lua has no such limit)

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: error when using externalfigure
  2012-11-26  9:50   ` Hans Hagen
  2012-11-26 10:00     ` luigi scarso
@ 2012-11-26 19:54     ` Dr. Hartmut Henkel
  2012-11-26 20:42       ` Hans Hagen
  1 sibling, 1 reply; 14+ messages in thread
From: Dr. Hartmut Henkel @ 2012-11-26 19:54 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

On Mon, 26 Nov 2012, Hans Hagen wrote:
> On 11/26/2012 10:36 AM, luigi scarso wrote:
> > On Mon, Nov 26, 2012 at 10:20 AM, Pavel Dohnal <pavel.dohnal@twobits.cz>
> > wrote:
> > > I have a big context source file which contains pictures from different
> > > sources. The problem is, that there are some pictures the context cannot
> > > process. It displays an error message and ends. I run the context from
> > > another script in batchmode. After finishing, the context creates a PDF
> > > file, which contains this problematic picture but the pdf is broken. It
> > > does
> > > not have numbers in the table of contents and it is not arranged by setup.
> > > Here is a minimal example:
> > > \starttext
> > > \externalfigure[http://cdn-locations-images.tripomatic.com/img-poi1295-5ZTynx-s.jpg][width=26.5mm]
> > > \stoptext

i just tried the minimal example here, it gives a valid PDF with a
properly (afaics) scaled image.

Creator:        ConTeXt - 2012.11.26 13:31
Producer:       LuaTeX-0.70.2

> > when I save the jpg  as eps from gimp
> > I see
> > width = 6096,00
> > height=4064,00

tried, can't see here.

> > The first value is off for TeX.
>
> if i print the values from the img object i get
>
> 17344.8pt
> 11563.2pt
>
> so the problem is deep down in the jpg reader ... the image is crippled in the
> sense that it has no valid resolution information
>
> something for hartmut to check in the img lib

can't confirm. Is this solved already?

Regards, Hartmut
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: error when using externalfigure
  2012-11-26 12:32       ` Hans Hagen
@ 2012-11-26 15:01         ` Sietse Brouwer
  0 siblings, 0 replies; 14+ messages in thread
From: Sietse Brouwer @ 2012-11-26 15:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users

This seems to me a case of garbage in, garbage out; I'd say it's the
script's job, rather than ConTeXt's, to ensure the images have the
correct dpi to get a reasonable width in inches. (Brr. I hate inches.
Disgusting, Mars-mission-wrecking way of measuring things.)

Here is some pseudocode. You'd still need a way to get
image.width_in_pixels and image.dpi from the image; I daresay either
`convert` or `exiftool` can do the job. See also this recent mail to
the list by Guy Stalnaker:
http://archive.contextgarden.net/message/20121123.232556.bf205641.en.html

projected_width = image.width_in_pixels / image.dpi
if projected_width > max_width_in_inches then
   required_dpi = image.width_in_pixels / max_width_in_inches
   shell('convert --density %f %s', required_dpi, image_name)
end

Cheers,
Sietse

On Mon, Nov 26, 2012 at 1:32 PM, Hans Hagen <pragma@wxs.nl> wrote:
> On 11/26/2012 11:00 AM, luigi scarso wrote:
>>
>> On Mon, Nov 26, 2012 at 10:50 AM, Hans Hagen <pragma@wxs.nl> wrote:
>>>
>>> On 11/26/2012 10:36 AM, luigi scarso wrote:
>>>>
>>>>
>>>> On Mon, Nov 26, 2012 at 10:20 AM, Pavel Dohnal <pavel.dohnal@twobits.cz>
>>>> wrote:
>>>>>
>>>>>
>>>>> Hello,
>>>>> I have a big context source file which contains pictures from different
>>>>> sources. The problem is, that there are some pictures the context
>>>>> cannot
>>>>> process. It displays an error message and ends. I run the context from
>>>>> another script in batchmode. After finishing, the context creates a PDF
>>>>> file, which contains this problematic picture but the pdf is broken. It
>>>>> does
>>>>> not have numbers in the table of contents and it is not arranged by
>>>>> setup.
>>>>> Here is a minimal example:
>>>>> \starttext
>>>>>
>>>>>
>>>>> \externalfigure[http://cdn-locations-images.tripomatic.com/img-poi1295-5ZTynx-s.jpg][width=26.5mm]
>>>>> \stoptext
>>>>
>>>>
>>>>
>>>>
>>>> when I save the jpg  as eps from gimp
>>>> I see
>>>> width = 6096,00
>>>> height=4064,00
>>>>
>>>> The first value is off for TeX.
>>>
>>>
>>>
>>> if i print the values from the img object i get
>>>
>>> 17344.8pt
>>> 11563.2pt
>>>
>>> so the problem is deep down in the jpg reader ... the image is crippled
>>> in
>>> the sense that it has no valid resolution information
>>>
>>> something for hartmut to check in the img lib
>>
>>
>> Hm, I'm not sure. It's an image that could be correct, but TeX cannot
>> manage it.
>> It has 240x160 pixels and 1ppi, so it's 6,096 meters x 4,06400meters
>> and 6 meters are too much for TeX (which still has its limits around
>> 5meters)
>> It's ok to print poster maybe, but then  TeX  is not the right tool.
>
>
> yes, but the 1,1 resolution prevents us from doing anything useful, i.e. we
> could for instance have something
>
> if xresolution < 72 then xresolution = 72 end
>
> but I'm not sure what the pdf backend will do as then the uses resolution
> for front and backend differ too much
>
> i'll add an overflow check but keep in mind that in that case scaling is
> bases on the limited size
>
>
> -----------------------------------------------------------------
>                                           Hans Hagen | PRAGMA ADE
>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                              | www.pragma-pod.nl
> -----------------------------------------------------------------
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: error when using externalfigure
  2012-11-26 10:00     ` luigi scarso
  2012-11-26 10:10       ` Martin Schröder
@ 2012-11-26 12:32       ` Hans Hagen
  2012-11-26 15:01         ` Sietse Brouwer
  1 sibling, 1 reply; 14+ messages in thread
From: Hans Hagen @ 2012-11-26 12:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 11/26/2012 11:00 AM, luigi scarso wrote:
> On Mon, Nov 26, 2012 at 10:50 AM, Hans Hagen <pragma@wxs.nl> wrote:
>> On 11/26/2012 10:36 AM, luigi scarso wrote:
>>>
>>> On Mon, Nov 26, 2012 at 10:20 AM, Pavel Dohnal <pavel.dohnal@twobits.cz>
>>> wrote:
>>>>
>>>> Hello,
>>>> I have a big context source file which contains pictures from different
>>>> sources. The problem is, that there are some pictures the context cannot
>>>> process. It displays an error message and ends. I run the context from
>>>> another script in batchmode. After finishing, the context creates a PDF
>>>> file, which contains this problematic picture but the pdf is broken. It
>>>> does
>>>> not have numbers in the table of contents and it is not arranged by
>>>> setup.
>>>> Here is a minimal example:
>>>> \starttext
>>>>
>>>> \externalfigure[http://cdn-locations-images.tripomatic.com/img-poi1295-5ZTynx-s.jpg][width=26.5mm]
>>>> \stoptext
>>>
>>>
>>>
>>> when I save the jpg  as eps from gimp
>>> I see
>>> width = 6096,00
>>> height=4064,00
>>>
>>> The first value is off for TeX.
>>
>>
>> if i print the values from the img object i get
>>
>> 17344.8pt
>> 11563.2pt
>>
>> so the problem is deep down in the jpg reader ... the image is crippled in
>> the sense that it has no valid resolution information
>>
>> something for hartmut to check in the img lib
>
> Hm, I'm not sure. It's an image that could be correct, but TeX cannot manage it.
> It has 240x160 pixels and 1ppi, so it's 6,096 meters x 4,06400meters
> and 6 meters are too much for TeX (which still has its limits around 5meters)
> It's ok to print poster maybe, but then  TeX  is not the right tool.

yes, but the 1,1 resolution prevents us from doing anything useful, i.e. 
we could for instance have something

if xresolution < 72 then xresolution = 72 end

but I'm not sure what the pdf backend will do as then the uses 
resolution for front and backend differ too much

i'll add an overflow check but keep in mind that in that case scaling is 
bases on the limited size

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: error when using externalfigure
  2012-11-26 10:40         ` Pavel Dohnal
@ 2012-11-26 10:50           ` luigi scarso
  0 siblings, 0 replies; 14+ messages in thread
From: luigi scarso @ 2012-11-26 10:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, Nov 26, 2012 at 11:40 AM, Pavel Dohnal <pavel.dohnal@twobits.cz> wrote:
> I can see the problem. Image has wrong information in its header. But what
> to do with it? As I mentioned before, I create context source by another
> script (PHP script) and php runs context. I have thousands of images so it
> is impossible to me every single image convert. But I created php gate which
> try convert images on the fly. When I try this particural image convert it
> gives me this image:
> http://cdn-images-squared.tripomatic.com/e46c68903d2c4445f05a0369578c17dd-270.jpg
> But after context runs this file it falls down with error message:
>
> !LuaTeX error: reading JPEG image failed (no JPEG header found)
>  ==> Fatal error occurred, no output PDF file produced!
>
> mtx-context     | fatal error: return code: 70
>
> Which is even worse, because although the user gets bad PDF it contains some
> information. In this case there is no pdf created. I looked in gimp for
> something bad in this image, but it looks ok to me.
> So do you have any advice what to do?
> Thanks
no errors here for
\starttext
\externalfigure[e46c68903d2c4445f05a0369578c17dd-270.jpg][width=26.5mm]
\externalfigure[e46c68903d2c4445f05a0369578c17dd-270.jpg]%[width=26.5mm]
\externalfigure[http://cdn-images-squared.tripomatic.com/e46c68903d2c4445f05a0369578c17dd-270.jpg][width=26.5mm]
\stoptext



--
luigi
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: error when using externalfigure
  2012-11-26 10:10       ` Martin Schröder
@ 2012-11-26 10:40         ` Pavel Dohnal
  2012-11-26 10:50           ` luigi scarso
  0 siblings, 1 reply; 14+ messages in thread
From: Pavel Dohnal @ 2012-11-26 10:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1748 bytes --]

I can see the problem. Image has wrong information in its header. But what
to do with it? As I mentioned before, I create context source by another
script (PHP script) and php runs context. I have thousands of images so it
is impossible to me every single image convert. But I created php gate
which try convert images on the fly. When I try this particural image
convert it gives me this image:
http://cdn-images-squared.tripomatic.com/e46c68903d2c4445f05a0369578c17dd-270.jpg
But after context runs this file it falls down with error message:

!LuaTeX error: reading JPEG image failed (no JPEG header found)
 ==> Fatal error occurred, no output PDF file produced!

mtx-context     | fatal error: return code: 70

Which is even worse, because although the user gets bad PDF it contains
some information. In this case there is no pdf created. I looked in gimp
for something bad in this image, but it looks ok to me.
So do you have any advice what to do?
Thanks

2012/11/26 Martin Schröder <martin@oneiros.de>

> 2012/11/26 luigi scarso <luigi.scarso@gmail.com>:
> > It has 240x160 pixels and 1ppi, so it's 6,096 meters x 4,06400meters
>
> I doubt that 1ppi is intended. :-)
>
> Best
>    Martin
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 2787 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: error when using externalfigure
  2012-11-26 10:00     ` luigi scarso
@ 2012-11-26 10:10       ` Martin Schröder
  2012-11-26 10:40         ` Pavel Dohnal
  2012-11-26 12:32       ` Hans Hagen
  1 sibling, 1 reply; 14+ messages in thread
From: Martin Schröder @ 2012-11-26 10:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users

2012/11/26 luigi scarso <luigi.scarso@gmail.com>:
> It has 240x160 pixels and 1ppi, so it's 6,096 meters x 4,06400meters

I doubt that 1ppi is intended. :-)

Best
   Martin
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: error when using externalfigure
  2012-11-26  9:50   ` Hans Hagen
@ 2012-11-26 10:00     ` luigi scarso
  2012-11-26 10:10       ` Martin Schröder
  2012-11-26 12:32       ` Hans Hagen
  2012-11-26 19:54     ` Dr. Hartmut Henkel
  1 sibling, 2 replies; 14+ messages in thread
From: luigi scarso @ 2012-11-26 10:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, Nov 26, 2012 at 10:50 AM, Hans Hagen <pragma@wxs.nl> wrote:
> On 11/26/2012 10:36 AM, luigi scarso wrote:
>>
>> On Mon, Nov 26, 2012 at 10:20 AM, Pavel Dohnal <pavel.dohnal@twobits.cz>
>> wrote:
>>>
>>> Hello,
>>> I have a big context source file which contains pictures from different
>>> sources. The problem is, that there are some pictures the context cannot
>>> process. It displays an error message and ends. I run the context from
>>> another script in batchmode. After finishing, the context creates a PDF
>>> file, which contains this problematic picture but the pdf is broken. It
>>> does
>>> not have numbers in the table of contents and it is not arranged by
>>> setup.
>>> Here is a minimal example:
>>> \starttext
>>>
>>> \externalfigure[http://cdn-locations-images.tripomatic.com/img-poi1295-5ZTynx-s.jpg][width=26.5mm]
>>> \stoptext
>>
>>
>>
>> when I save the jpg  as eps from gimp
>> I see
>> width = 6096,00
>> height=4064,00
>>
>> The first value is off for TeX.
>
>
> if i print the values from the img object i get
>
> 17344.8pt
> 11563.2pt
>
> so the problem is deep down in the jpg reader ... the image is crippled in
> the sense that it has no valid resolution information
>
> something for hartmut to check in the img lib

Hm, I'm not sure. It's an image that could be correct, but TeX cannot manage it.
It has 240x160 pixels and 1ppi, so it's 6,096 meters x 4,06400meters
and 6 meters are too much for TeX (which still has its limits around 5meters)
It's ok to print poster maybe, but then  TeX  is not the right tool.

--
luigi
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: error when using externalfigure
  2012-11-26  9:27 ` Hans Hagen
@ 2012-11-26  9:56   ` Pavel Dohnal
  0 siblings, 0 replies; 14+ messages in thread
From: Pavel Dohnal @ 2012-11-26  9:56 UTC (permalink / raw)
  Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1836 bytes --]

2012/11/26 Hans Hagen <pragma@wxs.nl>

> On 11/26/2012 10:20 AM, Pavel Dohnal wrote:
>
>> Hello,
>> I have a big context source file which contains pictures from different
>> sources.. The problem is, that there are some pictures the context
>>
>> cannot process. It displays an error message and ends. I run the context
>> from another script in batchmode. After finishing, the context creates a
>> PDF file, which contains this problematic picture but the pdf is broken.
>> It does not have numbers in the table of contents and it is not arranged
>> by setup.
>> Here is a minimal example:
>> \starttext
>> \externalfigure[http://cdn-**locations-images.tripomatic.**
>> com/img-poi1295-5ZTynx-s.jpg][**width=26.5mm<http://cdn-locations-images.tripomatic.com/img-poi1295-5ZTynx-s.jpg%5D%5Bwidth=26.5mm>
>> ]
>>
>> \stoptext
>>
>> When I run the context, it prints:
>> ! Dimension too large.
>>
>
> it all depends on the original ... how small is it? one pixel? one option
> is then to scale in  two steps:
>
> \scale[width=26.5cm]{\**externalfigure[...][width=1mm]**}
>
> or so
>
> ------------------------------**------------------------------**-----
>                                           Hans Hagen | PRAGMA ADE
>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                              | www.pragma-pod.nl
> ------------------------------**------------------------------**-----
>


Original file has width 240px and height 160px but no mather what I try:
\scale[width=26.5cm]{\**externalfigure[...][width=1mm]**}
\scale[width=26.5cm]{\**externalfigure[...][width=240mm]**}
\scale[width=26.5cm]{\**externalfigure[...][width=240px]**}
I got allways the same result with "Dimension too large" error message

Pavel Dohnal

[-- Attachment #1.2: Type: text/html, Size: 2663 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: error when using externalfigure
  2012-11-26  9:36 ` luigi scarso
@ 2012-11-26  9:50   ` Hans Hagen
  2012-11-26 10:00     ` luigi scarso
  2012-11-26 19:54     ` Dr. Hartmut Henkel
  0 siblings, 2 replies; 14+ messages in thread
From: Hans Hagen @ 2012-11-26  9:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Hartmut Henkel

On 11/26/2012 10:36 AM, luigi scarso wrote:
> On Mon, Nov 26, 2012 at 10:20 AM, Pavel Dohnal <pavel.dohnal@twobits.cz> wrote:
>> Hello,
>> I have a big context source file which contains pictures from different
>> sources. The problem is, that there are some pictures the context cannot
>> process. It displays an error message and ends. I run the context from
>> another script in batchmode. After finishing, the context creates a PDF
>> file, which contains this problematic picture but the pdf is broken. It does
>> not have numbers in the table of contents and it is not arranged by setup.
>> Here is a minimal example:
>> \starttext
>> \externalfigure[http://cdn-locations-images.tripomatic.com/img-poi1295-5ZTynx-s.jpg][width=26.5mm]
>> \stoptext
>
>
> when I save the jpg  as eps from gimp
> I see
> width = 6096,00
> height=4064,00
>
> The first value is off for TeX.

if i print the values from the img object i get

17344.8pt
11563.2pt

so the problem is deep down in the jpg reader ... the image is crippled 
in the sense that it has no valid resolution information

something for hartmut to check in the img lib

Hans



-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: error when using externalfigure
  2012-11-26  9:20 Pavel Dohnal
  2012-11-26  9:27 ` Hans Hagen
@ 2012-11-26  9:36 ` luigi scarso
  2012-11-26  9:50   ` Hans Hagen
  1 sibling, 1 reply; 14+ messages in thread
From: luigi scarso @ 2012-11-26  9:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, Nov 26, 2012 at 10:20 AM, Pavel Dohnal <pavel.dohnal@twobits.cz> wrote:
> Hello,
> I have a big context source file which contains pictures from different
> sources. The problem is, that there are some pictures the context cannot
> process. It displays an error message and ends. I run the context from
> another script in batchmode. After finishing, the context creates a PDF
> file, which contains this problematic picture but the pdf is broken. It does
> not have numbers in the table of contents and it is not arranged by setup.
> Here is a minimal example:
> \starttext
> \externalfigure[http://cdn-locations-images.tripomatic.com/img-poi1295-5ZTynx-s.jpg][width=26.5mm]
> \stoptext


when I save the jpg  as eps from gimp
I see
width = 6096,00
height=4064,00

The first value is off for TeX.




--
luigi
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: error when using externalfigure
  2012-11-26  9:20 Pavel Dohnal
@ 2012-11-26  9:27 ` Hans Hagen
  2012-11-26  9:56   ` Pavel Dohnal
  2012-11-26  9:36 ` luigi scarso
  1 sibling, 1 reply; 14+ messages in thread
From: Hans Hagen @ 2012-11-26  9:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 11/26/2012 10:20 AM, Pavel Dohnal wrote:
> Hello,
> I have a big context source file which contains pictures from different
> sources.. The problem is, that there are some pictures the context
> cannot process. It displays an error message and ends. I run the context
> from another script in batchmode. After finishing, the context creates a
> PDF file, which contains this problematic picture but the pdf is broken.
> It does not have numbers in the table of contents and it is not arranged
> by setup.
> Here is a minimal example:
> \starttext
> \externalfigure[http://cdn-locations-images.tripomatic.com/img-poi1295-5ZTynx-s.jpg][width=26.5mm
> <http://cdn-locations-images.tripomatic.com/img-poi1295-5ZTynx-s.jpg%5D%5Bwidth=26.5mm>]
> \stoptext
>
> When I run the context, it prints:
> ! Dimension too large.

it all depends on the original ... how small is it? one pixel? one 
option is then to scale in  two steps:

\scale[width=26.5cm]{\externalfigure[...][width=1mm]}

or so

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 14+ messages in thread

* error when using externalfigure
@ 2012-11-26  9:20 Pavel Dohnal
  2012-11-26  9:27 ` Hans Hagen
  2012-11-26  9:36 ` luigi scarso
  0 siblings, 2 replies; 14+ messages in thread
From: Pavel Dohnal @ 2012-11-26  9:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1632 bytes --]

Hello,
I have a big context source file which contains pictures from different
sources. The problem is, that there are some pictures the context cannot
process. It displays an error message and ends. I run the context from
another script in batchmode. After finishing, the context creates a PDF
file, which contains this problematic picture but the pdf is broken. It
does not have numbers in the table of contents and it is not arranged by
setup.
Here is a minimal example:
\starttext
\externalfigure[
http://cdn-locations-images.tripomatic.com/img-poi1295-5ZTynx-s.jpg][width=26.5mm
]
\stoptext

When I run the context, it prints:
! Dimension too large.

system          > tex > error on line 1 in file a.tex: Dimension too large
...

1 >>  \starttext
2     \externalfigure[
http://cdn-locations-images.tripomatic.com/img-poi1295-5ZTynx-s.jpg][width=26.5mm
]
3     \stoptext
4


\relocateexternalfigure ...d \foundexternalfigure
                                                  \bgroup \box
\foundexterna...
l.1 \relocateexternalfigure

\calculateexternalfigure ...ua {figures.include()}
                                                  \ctxlua
{figures.scale()}\...
\dodoplaceexternalfigure ...[][#1][#2][#3][#4][#5]
                                                  \dotagfigure \naturalvbox
...
<argument> ...1295-5ZTynx-s.jpg][][width=26.5mm][]
                                                  \fi
\firstofoneargument #1->#1

Because I have several thousands pictures, it is impossible for me to
correct them all. Is it somehow possible to run the context so that it
ignores the problematic pictures?
Thank you
Pavel Dohnal

[-- Attachment #1.2: Type: text/html, Size: 3652 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-11-26 20:42 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.384.1353926481.2161.ntg-context@ntg.nl>
2012-11-26 11:21 ` error when using externalfigure Robert Blackstone
2012-11-26  9:20 Pavel Dohnal
2012-11-26  9:27 ` Hans Hagen
2012-11-26  9:56   ` Pavel Dohnal
2012-11-26  9:36 ` luigi scarso
2012-11-26  9:50   ` Hans Hagen
2012-11-26 10:00     ` luigi scarso
2012-11-26 10:10       ` Martin Schröder
2012-11-26 10:40         ` Pavel Dohnal
2012-11-26 10:50           ` luigi scarso
2012-11-26 12:32       ` Hans Hagen
2012-11-26 15:01         ` Sietse Brouwer
2012-11-26 19:54     ` Dr. Hartmut Henkel
2012-11-26 20:42       ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).