Convert im6 q16 not authorized error constitute c writeimage 1037

SOLVED: ImageMagick convert error "convert-im6.q16: not authorized `foo.pdf' @ error/constitute.c/WriteImage/1037" or IsCoderAuthorized/408. But security issues remain.


UNIX / Linux keyboard.

ImageMagick «not authorized» PDF errors

Here’s the scenario:
I have scanned a multi-page document using Xsane.
I named the first one scan-0001.jpg
and Xsane automatically incremented the number for
each new file.
Now I want to convert that collection of JPEG images
into one PDF file.
This used to work, but now I just get an error:

$ ls
scan-0001.jpg   scan-0002.jpg   scan-0003.jpg   scan-0004.jpg
$ convert scan*.jpg scan.pdf
convert-im6.q16: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408.


Earlier versions instead said:
convert-im6.q16: not authorized `scan.pdf' @ error/constitute.c/WriteImage/1037.

What has happened?

ImageMagick has supported a security policy for some time.
The ImageMagick project itself, and the Linux distributions
in which it’s included, have made the policy a little
more strict.
Now it refuses to write PDF and PostScript files on my system.
The error message is true, but it isn’t helpful.
I don’t care precisely where within the code
that it was denied,
I just want to know how to turn this on!
However, that might be dangerous.

There are severe risks associated with PostScript data
for both servers and desktops.
Read on to see what the risks are.
There are workarounds, so maybe you will want
to enable PDF and PostScript processing by ImageMagick.
But make sure you understand the risks before continuing.

Some Data Can Be Dangerous

Ghostscript
project

PostScript is actually a programming language.
You know that you can run a tool like
gv or ghostview
to view PostScript files,
or CUPS or another print service to send something
to a printer.
But you may not realize that those tools use the
Ghostscript libraries, and
Ghostscript runs the PostScript program
in the input file.

The usual way of describing this is:

PostScript is a page description language.

Ghostscript is a PostScript interpreter.

PDF or Portable Document Format is based on PostScript.
If you use an Adobe tool, it will include its own
PostScript interpreter. (And, bring along all the risks
of the Adobe suite!)

Open-source PDF tools will rely on Ghostscript.

This is where the danger lies.
When you view a PostScript or PDF file downloaded
from the Internet or received from a stranger,
you are running a program from
an untrusted source.

Ghostscript includes a simple command-line option,
the -dSAFER flag.
That means «Excecute most of the PostScript language,
except do not
execute external programs (like shell escapes) or
modify files.»
The manual page recommends the flag without
explaining what is really happening:

-dSAFER

Restricts file operations the job can perform.
Strongly recommended for spoolers, conversion scripts or
other sensitive environments where a badly written or
malicious PostScript program code must be
prevented from changing important files.

Multiple ways to exploit Ghostscript

Multiple Ghostscript -dSAFER
sandbox problems

The above sounds good, as far as it goes.
However, attackers have found ways to bypass the
-dSAFER flag.
And, more recently, they have found
alternative attack vectors that
-dSAFER doesn’t catch.
There’s a

very good argument
that this is a language specification flaw in PostScript.
In other words, PostScript defines a language
with unfixable security problems.

Artifex Software, Inc., maintains the Ghostscript project.
While they

made patches available,
they didn’t release a new, patched version.

These PostScript problems can open you to attacks in
two very different circumstances.
First, if you run a server that allows people to upload
images for processing.
Second, if you use a Linux desktop with the default
settings found on many distributions.

Postscript and PDF Risks on
Image-Processing Web Servers

Imagine a server that allows users to upload images
for processing.
Conversion between JPEG and other formats,
resizing, or maybe enhancing.

That server probably uses ImageMagick as its back end.
ImageMagick doesn’t pay attention to file name extensions.
It reads the beginning of the file to figure out what format
it contains — JPEG, GIF, PNG, whatever.
That means that an attacker could rename a hostile
PostScript file whatever.jpg
and upload it, bypassing any intended restrictions
for «image data only».
The server would give the new input data to ImageMagick,
which would run the hostile PostScript program.
That could include arbitrary shell commands run with
the credentials of the web server process.

ImageMagick uses a policy file to specify
which operations are allowed on which data types.
On a server that allows untrusted
users to upload data for processing, ImageMagick
should have PostScript and PDF disabled.

The file /etc/ImageMagick-6/policy.xml
should contain:

[... lines deleted ...]
<policymap>
  [... lines deleted ...]
  <policy domain="coder" rights="none" pattern="PS" />
  <policy domain="coder" rights="none" pattern="PS2" />
  <policy domain="coder" rights="none" pattern="PS3" />
  <policy domain="coder" rights="none" pattern="EPS" />
  <policy domain="coder" rights="none" pattern="PDF" />
  <policy domain="coder" rights="none" pattern="XPS" />
  [... lines deleted ...]
</policymap>

If we instead are talking about your desktop,
then you might want to enable those data
types for ImageMagick.

Re-enabling PostScript and PDF for ImageMagick

ImageMagick
Security Policy

ImageMagick’s default security policy imposes limits of
256 MiB memory,
image dimensions of no more than 8196 pixels high or wide,
files can be no larger than 1 GiB,
individual tasks can take no more than 120 seconds,
and others.
See the

ImageMagick security policy
page for more details.
I can increase those limits if I want.

There’s an easy way to see the current security policy
settings on your system:

$ identify -list policy | less 

If I want to re-enable PostScript and PDF formats for
ImageMagick, I could make the following changes in the file

/etc/ImageMagick-6/policy.xml

[... about 70 lines deleted ...]
  <!-- disable ghostscript format types -->
  <!--
  <policy domain="coder" rights="none" pattern="PS" />
  <policy domain="coder" rights="none" pattern="EPI" />
  <policy domain="coder" rights="none" pattern="PDF" />
  <policy domain="coder" rights="none" pattern="XPS" />
  -->
  <policy domain="coder" rights="read|write" pattern="PDF,PS" />
</policymap> 

I was interested in generating a PDF file from a series of
JPEG scans of pages.
So, I didn’t need to use «read|write» above.
I could have allowed only «write»
and still accomplished what I want.

Problem Solved!

$ convert scan-*jpg scan.pdf
$ convert scan-*jpg scan.ps
$ ls -l scan*
-rw-r--r-- 1 cromwell cromwell   131879 Nov 22 10:34 scan-0001.jpg
-rw-r--r-- 1 cromwell cromwell   137088 Nov 22 10:35 scan-0002.jpg
-rw-r--r-- 1 cromwell cromwell   132204 Nov 22 10:35 scan-0003.jpg
-rw-r--r-- 1 cromwell cromwell   133016 Nov 22 10:36 scan-0004.jpg
-rw-rw-r-- 1 cromwell cromwell   479604 Nov 22 11:41 scan.pdf
-rw-rw-r-- 1 cromwell cromwell 13517838 Nov 22 11:41 scan.ps 

However, fixing this problem has shown us
other PostScript-based security problems.

Further Postscript and PDF Risks on Desktops

You can

search
for software trying to use Ghostscript safely
by calling it with the -dSAFER flag,
which we realize doesn’t work.
It’s a long list:

a2ps,
auctex,
auto-07p,
boost1.62,
boost1.63,
boost1.67,
c2050,
cairo,
calligra,
camlimages,
cenon.app,
chezscheme,
claws-mail,
context,
courier,
cups-filters,
cups-pdf,
cups-x2go,
derivations,
djtools,
efax,
efax-gtk,
emacs,
emacs25,
evolution,
fbi,
fig2dev,
fig2ps,
fim,
foo2zjs,
foomatic-db-engine,
freebsd-smbfs,
gdal,
ghostscript,
gimp,
gle-graphics,
gmt,
gramps,
graphicsmagick,
groff,
gv,
hplip,
ifhp,
imagemagick,
impose+,
k2pdfopt,
kde4libs,
klatexformula,
latex2rtf,
latexdiff,
leafnode,
libpodofo,
libpostscriptbarcode,
lilypond,
luasocket,
lyx,
m2300w,
magicfilter,
magics++,
mgetty,
min12xxw,
mupdf,
nltk,
nx-libs,
ocrmypdf,
octave,
plastex,
pnm2ppa,
printfilters-ppd,
ps2eps,
pstotext,
python-uniconvertor,
pyxplot,
r-cran-tm,
racket,
ruby-asciidoctor-pdf,
ruby-tioga,
stex,
texlive-base,
texlive-bin,
texlive-extra,
texlive-lang,
texstudio,
texworks-manual,
vim,
webhelpers,
xdvik-ja,
xemacs21-packages,
xfig,
xutils-dev,
yorick,
yorick-mira,
yorick-yutils

Some are obvious, like components of LaTeX and print service.
Other, though, are somewhat cryptic.
There are some dangerous ones lurking in the list.

Desktop environments like Gnome and KDE include file
indexing and search tools.
These automatically run in the background, reading
all of your files with a variety of software
packages, including the dangerous PostScript interpreters.

If you’re wondering why your desktop runs slowly,
and why the disk activity light is so very busy,
it’s likely because of these indexing tools!

Also, a graphical file manager may use PostScript
interpreters to create previews or «thumbnails».

Unfortunately, all of these may have to be disabled or
reconfigured for each user.
Depending on your distribution, there may be
a system-wide configuration file under
/usr/share/kde-settings/kde-profile/default/share/config/.
And, we can’t simply remove the packages due to dependencies.

Your distribution might have put things in strange places.
So, before continuing you might want to find where
configuration files might have been hidden.

$ find .??* -type f | sort | egrep 'baloo|nepomuk|akonadi|strigi|dolphin'

Disabling Nepomuk and Strigi Indexing Services

Edit ~/.kde*/share/config/nepomukserverrc
and change any start or autostart
values from true to false.

[... lines deleted ...]

[Basic Settings]
Start Nepomuk=false

[Service-nepomukfileindexer]
autostart=false

[Service-nepomuktelepathyservice]
autostart=false

[... lines deleted ...]

Disabling Baloo Indexing Service

Edit ~/.kde*/share/config/baloofilerc
or ~/.config/baloofilerc
and change Indexing-Enabled to
false.

[... lines deleted ...]

[Basic Settings]
Indexing-Enabled=false

[... lines deleted ...]

Disabling Akonadi Indexing Service

Edit ~/kde*/share/config/akonadiserverrc
or ~/.config/akonadi/akonadiserverrc
and change StartServer to
false.

[... lines deleted ...]
StartServer=false

Disabling PostScript/PDF Previews in the Dolphin File Manager

Edit ~/.kde*/share/config/dolphinrc
or .config/dolphinrc.
In the [PreviewSettings] stanza,
Plugins should not include
gsthumbnail

[... lines deleted ...]

[PreviewSettings]
Plugins=directorythumbnail,imagethumbnail,jpegthumbnail,rawthumbnail,svgthumbnail

[... lines deleted ...]

Or, you can change it through its menus.
Control → Configure Dolphin →
General → Previews:

Preferences settings for the Dolphine file manager

Back to the Linux / Open-Source Page

I’ve written a simple web scraper for a comic website. I’m running it on Ubuntu (Linux ubuntu 4.18.0-16-generic #17~18.04.1-Ubuntu) but when I execute the script (permissions set to chmod ug+x) I keep getting a series of errors with imported system libraries along with a confusing syntax error:

import-im6.q16: not authorized `time' @ error/constitute.c/WriteImage/1037.
import-im6.q16: not authorized `os' @ error/constitute.c/WriteImage/1037.
import-im6.q16: not authorized `sys' @ error/constitute.c/WriteImage/1037.
import-im6.q16: not authorized `re' @ error/constitute.c/WriteImage/1037.
import-im6.q16: not authorized `requests' @ error/constitute.c/WriteImage/1037.
from: can't read /var/mail/bs4
./poorlywrittenscraper.py: line 15: DEFAULT_DIR_NAME: command not found
./poorlywrittenscraper.py: line 16: syntax error near unexpected token `('
./poorlywrittenscraper.py: line 16: `COMICS_DIRECTORY = os.path.join(os.getcwd(), DEFAULT_DIR_NAME)'

Interestingly enough, when I run the same script via python3 it fires up, creates the folder, fetches the images but… does not save them. o.O

Any idea what am I missing here or how to fix this?

Here’s the full code of the script:

"""
A simple image downloader for poorlydrawnlines.com/archive
"""
import time
import os
import sys
import re
import concurrent.futures


import requests
from bs4 import BeautifulSoup as bs


DEFAULT_DIR_NAME = "poorly_created_folder"
COMICS_DIRECTORY = os.path.join(os.getcwd(), DEFAULT_DIR_NAME)


LOGO = """
a Python comic(al) scraper for poorlydwarnlines.com
                         __
.-----.-----.-----.----.|  |.--.--.
|  _  |  _  |  _  |   _||  ||  |  |
|   __|_____|_____|__|  |__||___  |
|__|                        |_____|
                __ __   __
.--.--.--.----.|__|  |_|  |_.-----.-----.
|  |  |  |   _||  |   _|   _|  -__|     |
|________|__|  |__|____|____|_____|__|__|
.-----.----.----.---.-.-----.-----.----.
|__ --|  __|   _|  _  |  _  |  -__|   _|
|_____|____|__| |___._|   __|_____|__|
                      |__|
version: 0.4 | author: baduker | https://github.com/baduker
"""


ARCHIVE_URL = "http://www.poorlydrawnlines.com/archive/"
COMIC_PATTERN = re.compile(r'http://www.poorlydrawnlines.com/comic/.+')

def download_comics_menu(comics_found):
    """
    Main download menu, takes number of available comics for download
    """
    print("nThe scraper has found {} comics.".format(len(comics_found)))
    print("How many comics do you want to download?")
    print("Type 0 to exit.")

    while True:
        try:
            comics_to_download = int(input(">> "))
        except ValueError:
            print("Error: expected a number. Try again.")
            continue
        if comics_to_download > len(comics_found) or comics_to_download < 0:
            print("Error: incorrect number of comics to download. Try again.")
            continue
        elif comics_to_download == 0:
            sys.exit()
        return comics_to_download


def grab_image_src_url(session, url):
    """
    Fetches urls with the comic image source
    """
    response = session.get(url)
    soup = bs(response.text, 'html.parser')
    for i in soup.find_all('p'):
        for img in i.find_all('img', src=True):
            return img['src']


def download_and_save_comic(session, url):
    """
    Downloads and saves the comic image
    """
    file_name = url.split('/')[-1]
    with open(os.path.join(COMICS_DIRECTORY, file_name), "wb") as file:
        response = session.get(url)
        file.write(response.content)


def fetch_comics_from_archive(session):
    """
    Grabs all urls from the poorlydrawnlines.com/archive and parses for only those that link to published comics
    """
    response = session.get(ARCHIVE_URL)
    soup = bs(response.text, 'html.parser')
    comics = [url.get("href") for url in soup.find_all("a")]
    return [url for url in comics if COMIC_PATTERN.match(url)]


def download_comic(session, url):
    """
    Download progress information
    """
    print("Downloading: {}".format(url))
    url = grab_image_src_url(session, url)
    download_and_save_comic(session, url)


def main():
    """
    Encapsulates and executes all methods in the main function
    """
    print(LOGO)

    session = requests.Session()

    comics = fetch_comics_from_archive(session)
    comics_to_download = download_comics_menu(comics)

    try:
        os.mkdir(DEFAULT_DIR_NAME)
    except OSError as exc:
        sys.exit("Failed to create directory (error_no {})".format(exc.error_no))

    start = time.time()
    with concurrent.futures.ThreadPoolExecutor() as executor:
        executor.map(lambda url: download_comic(session, url), comics[:comics_to_download])
    executor.shutdown()
    end = time.time()
    print("Finished downloading {} comics in {:.2f} sec.".format(comics_to_download, end - start))

if __name__ in "__main__":
    main()

All of a sudden on 18.04 of Xubuntu, my ability to convert image files to PDF has stopped working.

Normally, I could do the following at the terminal:

$ convert image*.jpg NEW.pdf

to convert a series of image files into one PDF file. Now I get an error. For instance:

$ convert MarsSunset.jpg new.pdf
convert-im6.q16: not authorized 'new.pdf' @ error/constitute.c/WriteImage/1037.

After a few weeks of these errors (and resorting to GIMP to convert the image files by opening and then exporting them to PDF format), I found the following posts on the twitter.

Ross Campbell III @rosscampbell Oct 5

If you update Ubuntu and your web app’s PDF generation breaks, it’s because the latest Ubuntu ImageMagick packages DISABLE generation of .ps, .eps, .pdf, and .xps files !!! You can fix this by editing /etc/ImageMagick*/policy.xml and deleting the ‘disabled’ lines.

Hee-Woong Lim @heewlim Oct 5

Due to recent security vulnerability of ImageMagick, some file format has been disabled. If you wanna convert those file format (such as pdf -> png), you need to modify /etc/ImageMagick/policy.xml https://usn.ubuntu.com/3785-1/

If you click on the security notice, you will see the following:

Due to a large number of issues discovered in GhostScript that prevent it from being used by ImageMagick safely, this update includes a default policy change that disables support for the Postscript and PDF formats in ImageMagick. This policy can be overridden if necessary by using an alternate ImageMagick policy configuration.

That policy change, as noted by Ross Campbell, is disabling PS, EPS, PDF, and XPS files for use with convert. Yeesch.

So, there is a security problem with PDF files. PDF files on Linux systems are usually handled by ghostscript (via the terminal command gs). And, ImageMagick (done through the terminal convert command) uses ghostscript for reading and writing PDF files. Because the security problems are serious and numerous, ImageMagick’s access to PDF files is then cut off.

Granted, through these security flaws in PDF someone could craft a malicious image file that, when converted by ImageMagick into a PDF, will then do very nasty things to your computer.

But, ghostscript has since been updated once and once again with security fixes. How about a fix for ImageMagick to get PDF functionality back? Or, at least an explanation of progress towards fixing this issue?

In the meantime, you can install img2pdf:

$ sudo apt-get install img2pdf

The terminal command to run will be in this format:

$ img2pdf --output NEWFILE.pdf IMAGEFILE.png

Or, as noted by Ross Campbell, you can ignore the security problems and delete the policy restrictions. Sigh.

Утилита convert из пакета ImageMagick позволяет легко создать многостраничный pdf документ из набора png, jpg или других графических файлов. На этом возможности утилиты convert не ограничиваются.

Собрать несколько графических файлов в один многостраничный pdf документ можно командой

convert 'file1.jpg' 'file2.jpg' 'file3.jpg' 'file.pdf'

Если работа команды convert заканчивается ошибкой:

convert-im6.q16: not authorized `Паспорт1.pdf' @ error/constitute.c/WriteImage/1037.

Поправьте файл политик /etc/ImageMagick-6/policy.xml Закоментируйте строку

<policy domain="coder" rights="none" pattern="PDF" />
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policymap [
<!ELEMENT policymap (policy)+>
<!ELEMENT policy (#PCDATA)>
<!ATTLIST policy domain (delegate|coder|filter|path|resource) #IMPLIED>
<!ATTLIST policy name CDATA #IMPLIED>
<!ATTLIST policy rights CDATA #IMPLIED>
<!ATTLIST policy pattern CDATA #IMPLIED>
<!ATTLIST policy value CDATA #IMPLIED>
]>
<!--
  Configure ImageMagick policies.

  Domains include system, delegate, coder, filter, path, or resource.

  Rights include none, read, write, and execute.  Use | to combine them,
  for example: "read | write" to permit read from, or write to, a path.

  Use a glob expression as a pattern.

  Suppose we do not want users to process MPEG video images:

    <policy domain="delegate" rights="none" pattern="mpeg:decode" />

  Here we do not want users reading images from HTTP:

    <policy domain="coder" rights="none" pattern="HTTP" />

  Lets prevent users from executing any image filters:

    <policy domain="filter" rights="none" pattern="*" />

  The /repository file system is restricted to read only.  We use a glob
  expression to match all paths that start with /repository:
  
    <policy domain="path" rights="read" pattern="/repository/*" />

  Let's prevent possible exploits by removing the right to use indirect reads.

    <policy domain="path" rights="none" pattern="@*" />

  Any large image is cached to disk rather than memory:

    <policy domain="resource" name="area" value="1GB"/>

  Define arguments for the memory, map, area, width, height, and disk resources
  with SI prefixes (.e.g 100MB).  In addition, resource policies are maximums
  for each instance of ImageMagick (e.g. policy memory limit 1GB, -limit 2GB
  exceeds policy maximum so memory limit is 1GB).
-->
<policymap>
  <!-- <policy domain="resource" name="temporary-path" value="/tmp"/> -->
  <policy domain="resource" name="memory" value="256MiB"/>
  <policy domain="resource" name="map" value="512MiB"/>
  <policy domain="resource" name="width" value="16KP"/>
  <policy domain="resource" name="height" value="16KP"/>
  <policy domain="resource" name="area" value="128MB"/>
  <policy domain="resource" name="disk" value="1GiB"/>
  <!-- <policy domain="resource" name="file" value="768"/> -->
  <!-- <policy domain="resource" name="thread" value="4"/> -->
  <!-- <policy domain="resource" name="throttle" value="0"/> -->
  <!-- <policy domain="resource" name="time" value="3600"/> -->
  <!-- <policy domain="system" name="precision" value="6"/> -->
  <!-- not needed due to the need to use explicitly by mvg: -->
  <!-- <policy domain="delegate" rights="none" pattern="MVG" /> -->
  <!-- use curl -->
  <policy domain="delegate" rights="none" pattern="URL" />
  <policy domain="delegate" rights="none" pattern="HTTPS" />
  <policy domain="delegate" rights="none" pattern="HTTP" />
  <!-- in order to avoid to get image with password text -->
  <policy domain="path" rights="none" pattern="@*"/>
  <policy domain="cache" name="shared-secret" value="passphrase" stealth="true"/>
  <!-- disable ghostscript format types -->
  <policy domain="coder" rights="none" pattern="PS" />
  <policy domain="coder" rights="none" pattern="PS2" />
  <policy domain="coder" rights="none" pattern="PS3" />
  <policy domain="coder" rights="none" pattern="EPS" />
  <!-- policy domain="coder" rights="none" pattern="PDF" / -->
  <policy domain="coder" rights="none" pattern="XPS" />
</policymap>

Утилита convert может многое, например команда

convert file.jpg -crop 690x470+37+38 +repage out.jpg

обрезает файл file.jpg в размер 690х470 px с отступом от левого верхнего угла 37х38 px и сохраняет результат в файл out.jpg

@yoya

etc/ImageMagick-6/policy.xml

<policy domain=»coder» rights=»read» pattern=»PNG» />

command execution

% ~/ImageMagick/6.9.7-6/bin/convert in.jpg out.png
convert: not authorized `out.png’ @ error/constitute.c/WriteImage/1037.
% ~/ImageMagick/6.9.7-7/bin/convert in.jpg out.png
Assertion failed: (exception != (ExceptionInfo *) NULL), function ClearExceptionInfo, file magick/exception.c, line 423.
zsh: abort ~/ImageMagick/6.9.7-7/bin/convert in.jpg out.png

environment

  • macOS Sierra 10.12.3
  • dependent library setup by homebrew.

@mikayla-grace

dlemstra

pushed a commit
that referenced
this issue

Feb 6, 2017

@dlemstra

Can you test and close this issue after the next release @yoya?

@yoya



Copy link


Contributor

Author

Beta(6--20170211,7--20170212) testing all passed.
I’m waiting for the next version release.

environment

  • macOS Sierra 10.12.3
  • dependent library setup by homebrew.
  • Install Prefix
    • ImageMagick-6.9.7-8-beta20170211.tar.gz => ~/ImageMagick/6.9.7-8-beta20170211/
    • ImageMagick-7.0.4-8-beta20170212.tar.gz => ~/ImageMagick/7.0.4-8-beta20170212/

test result

  • etc/ImageMagick-[67]/policy.xml

command & result

  • <policy domain=»coder» rights=»read» pattern=»PNG» />

% ~/ImageMagick/6.9.7-8-beta20170211/bin/convert in.jpg out.jpg
% ~/ImageMagick/6.9.7-8-beta20170211/bin/convert in.jpg out.png
convert: not authorized `out.png’ @ error/constitute.c/WriteImage/1043.

% ~/ImageMagick/7.0.4-8-beta20170212/bin/convert in.jpg out.jpg
% ~/ImageMagick/7.0.4-8-beta20170212/bin/convert in.jpg out.png
convert: not authorized `out.png’ @ error/constitute.c/WriteImage/1029.

  • <policy domain=»coder» rights=»write» pattern=»PNG» />

% ~/ImageMagick/6.9.7-8-beta20170211/bin/convert in.jpg out.png
% ~/ImageMagick/6.9.7-8-beta20170211/bin/convert in.png out.png
convert: not authorized in.png' @ error/constitute.c/ReadImage/420. convert: no images defined out.png’ @ error/convert.c/ConvertImageCommand/3258.

% ~/ImageMagick/7.0.4-8-beta20170212/bin/convert in.jpg out.png
% ~/ImageMagick/7.0.4-8-beta20170212/bin/convert in.png out.png
convert: not authorized in.png' @ error/constitute.c/ReadImage/425. convert: no images defined out.png’ @ error/convert.c/ConvertImageCommand/3254.

@yoya



Copy link


Contributor

Author

all OK!
thank you.

environment

  • macOS Sierra 10.12.3
  • dependent library setup by homebrew.
  • Install Prefix
    • ImageMagick-6.9.7-8.tar.gz => ~/ImageMagick/6.9.7-8/
    • ImageMagick-7.0.4-8.tar.gz => ~/ImageMagick/7.0.4-8/

test result

  • etc/ImageMagick-[67]/policy.xml

command & result

  • <policy domain=»coder» rights=»read» pattern=»PNG» />

% ~/ImageMagick/6.9.7-8/bin/convert in.jpg out.jpg
% ~/ImageMagick/6.9.7-8/bin/convert in.png out.jpg
% ~/ImageMagick/6.9.7-8/bin/convert in.jpg out.png
convert: not authorized `out.png’ @ error/constitute.c/WriteImage/1043.

% ~/ImageMagick/7.0.4-8/bin/convert in.jpg out.jpg
% ~/ImageMagick/7.0.4-8/bin/convert in.png out.jpg
% ~/ImageMagick/7.0.4-8/bin/convert in.jpg out.png
convert: not authorized `out.png’ @ error/constitute.c/WriteImage/1029.

  • <policy domain=»coder» rights=»write» pattern=»PNG» />

% ~/ImageMagick/6.9.7-8/bin/convert in.jpg out.png
% ~/ImageMagick/6.9.7-8/bin/convert in.png out.png
convert: not authorized in.png' @ error/constitute.c/ReadImage/420. convert: no images defined out.png’ @ error/convert.c/ConvertImageCommand/3258.
% ~/ImageMagick/6.9.7-8/bin/convert in.png out.jpg
convert: not authorized in.png' @ error/constitute.c/ReadImage/420. convert: no images defined out.jpg’ @ error/convert.c/ConvertImageCommand/3258.

% ~/ImageMagick/7.0.4-8/bin/convert in.jpg out.png
% ~/ImageMagick/7.0.4-8/bin/convert in.png out.png
convert: not authorized in.png' @ error/constitute.c/ReadImage/425. convert: no images defined out.png’ @ error/convert.c/ConvertImageCommand/3254.
% ~/ImageMagick/7.0.4-8/bin/convert in.png out.jpg
convert: not authorized in.png' @ error/constitute.c/ReadImage/425. convert: no images defined out.jpg’ @ error/convert.c/ConvertImageCommand/3254.

Bug #1796563 reported by
Steve Dodd
on 2018-10-07

This bug affects 34 people

Affects Status Importance Assigned to Milestone


imagemagick (Ubuntu)

Confirmed

Undecided


Unassigned

Bug Description

8:6.8.9.9-7ubuntu5.13 breaks the convert command as used by my home-brew document management system:

$ convert -density 200 -quality 40 null: 10-07-dvla.pdf 10-07-dvla.jpg
convert: not authorized `10-07-dvla.pdf’ @ error/constitute.c/ReadImage/412.

I appreciate that this is likely a security fix for something, but I can find no useful information in the changelog.Debian or NEWS files on what has changed, and what I should do to restore previous functionality.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: imagemagick 8:6.8.9.9-7ubuntu5.13
ProcVersionSignature: Ubuntu 4.15.0-33.36-generic 4.15.18
Uname: Linux 4.15.0-33-generic x86_64
NonfreeKernelModules: qnx4 hfsplus hfs minix ntfs jfs i915 snd_hda_codec_hdmi intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp snd_hda_codec_realtek snd_hda_codec_generic dcdbas snd_hda_intel snd_hda_codec snd_hda_core intel_cstate dell_wmi intel_rapl_perf dell_smbios_wmi dell_smbios wmi_bmof sparse_keymap dell_wmi_descriptor cp210x usbserial mei_me mei shpchp intel_pch_thermal mac_hid vhci_hcd usbip_core r8169 wmi
ApportVersion: 2.20.1-0ubuntu2.18
Architecture: amd64
CurrentDesktop: XFCE
Date: Sun Oct 7 14:35:08 2018
InstallationDate: Installed on 2017-01-08 (637 days ago)
InstallationMedia: Xubuntu 16.04 LTS «Xenial Xerus» — Release amd64 (20160420.1)
SourcePackage: imagemagick
UpgradeStatus: No upgrade log present (probably fresh install)

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Daewoo мультиварка ошибка е4
  • Daewoo mini стиральная машина ошибка
  • Context3d not available как исправить
  • D3d error 0x8876017c
  • Content server error 20004

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии