Hi Wolfgang,

thanks for replying.

On Sun, Mar 23, 2025 at 18:34 (+0100), Wolfgang Schuster wrote:

> Am 22.03.2025 um 13:18 schrieb Bruce Horrocks:

>>> On 20 Mar 2025, at 17:09, Jim <[email protected]> wrote:

>>> I use JPEG2000 images and, unit the most recent update, these worked fine
>>> for me (i.e., anywhere a "normal" JPEG could be included, a JPEG2000 could
>>> be included).

>>> This seems to have come to a crashing halt with the 2025.02.28 update.  Now
>>> I just get the gray box.  Here is an example of it not working (I have
>>> attached a .JP2 image of ConTeXt's favourite cow):

>> Which OS are you using because I have no problem displaying sample1.jp2
>> from <https://toolsfairy.com/image-test/sample-jp2-files> on a Mac using
>> 2025.02.28.

> I would add the following tracker at the beginning to get more information
> out of ConTeXt.

> \enabletrackers[graphics.*]

>> \starttext
>> \externalfigure[sample1.jp2][height=20cm]
>> \stoptext

Thanks for that suggestion.

With that suggestion, and a bit more digging, the "mystery" is solved.

First, I want to apologize for making an unforgivable mistake on my initial
question, because although I thought (*cough*) I confirmed that example
didn't work, in fact it does work for me (at least now, and presumably
before).

A more recent message I sent had the one which didn't work, and still doesn't:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\definegraphictypesynonym [jpx] [jp2]
\setupexternalfigures[location={local,default}]

\starttext

\line{%
    \externalfigure[cow.pdf][height=1in]%
    \hss
    \externalfigure[cow-jp2.jp2][height=1in]}

\vskip 20pt

\line{%
    \externalfigure[cow-jpg.jpg][height=1in]%
    \hss
    \externalfigure[cow-jpx.jpx][height=1in]}

\stoptext

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The problem (as I now discover, because of Wolfgang's sample and tracker
suggestion) is the line
         \definegraphictypesynonym [jpx] [jp2]
which I egregiously omitted from my first (over-)simplified example.

I needed this before 2025.02.28 because up until then the .jpx extension
was not known to ConTeXt, and some helpful person on this very mailing list
suggested I add that to my context source files.

However, including that line in the 2025.02.28 version (with the tracker)
and running context produces this output:

figures         > label: cow-jp2.jp2, name: cow-jp2.jp2, parent: cow-jp2.jp2
graphics        > inclusion > forcing format 'jp2'
graphics        > inclusion > unknown format 'jp2'
graphics        > inclusion > './cow-jp2.jp2' resolved to './cow-jp2.jp2'
graphics        > inclusion > checking conversion of './cow-jp2.jp2', fullname 
'./cow-jp2.jp2', old format 'jp2', new format 'pdf', conversion 'default', 
resolution 'default', crop 'yes', arguments ''
graphics        > inclusion > format 'jp2' is not supported

So even in a test file with no .jpx file like this

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\definegraphictypesynonym [jpx] [jp2]
\setupexternalfigures[location={local,default}]

\enabletrackers[graphics.*]

\starttext

\line{%
    \externalfigure[cow.pdf][height=1in]%
    \hss
    \externalfigure[cow-jp2.jp2][height=1in]}

\stoptext

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

the \definegraphictypesynonym causes context to not "know" .jp2 files.


In summary, it would appear that
        \definegraphictypesynonym [jpx] [jp2]
is now a very bad thing to have in a context file.


I used diffpdf to compare two versions of a 24-page document: the one I
created before upgrading to 2025.02.28 and the one I just did now, after
removing that \definegraphictypesynonym line.  Aside from a couple of
changes in line-breaking, and some (presumed) false positive differences,
all seems to be good.

Again, thanks to everyone who contributed, and I am sincerely and profusely
sorry for wasting your time.

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

maillist : [email protected] / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to