Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Feb 2011 20:32:14 GMT
From:      Kurt Lidl <kurt.lidl@cello.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/154852: converters/mpack does not recognize png files
Message-ID:  <201102172032.p1HKWE6v090343@red.freebsd.org>
Resent-Message-ID: <201102172040.p1HKe6Fw073351@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         154852
>Category:       ports
>Synopsis:       converters/mpack does not recognize png files
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 17 20:40:06 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Kurt Lidl
>Release:        8.1-Release
>Organization:
Cello Software, LLC
>Environment:
FreeBSD dev01.cello.com 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:55:53 UTC 2010     root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
The encoded output from mpack on a PNG file will tag it as
application/octet-stream.  Ideally, it would be tagged as
image/png.

>How-To-Repeat:

>Fix:
The attached shar file makes the patch-magic.c have the right
data to identify image/png files.


Patch attached with submission follows:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	/usr/ports/converters/mpack/files/patch-magic.c
#
echo x - /usr/ports/converters/mpack/files/patch-magic.c
sed 's/^X//' >/usr/ports/converters/mpack/files/patch-magic.c << 'b642b52f37529b7136783f89b1ecc98f'
X--- magic.c.orig	2003-07-21 16:35:31.000000000 -0400
X+++ magic.c	2011-02-17 15:17:14.374973627 -0500
X@@ -23,6 +23,7 @@
X  * SOFTWARE.
X  */
X #include <stdio.h>
X+#include <string.h>
X 
X /* Description of the various file formats and their magic numbers */
X struct magic {
X@@ -35,6 +36,7 @@
X static struct magic magic[] = {
X     { "image/gif", "GIF", 0 },
X     { "image/jpeg", "\377\330\377", 0 },
X+    { "image/png", "\211PNG", 0 },
X     { "video/mpeg", "\0\0\001\263", 4 },
X     { "application/postscript", "%!", 0 },
X };
b642b52f37529b7136783f89b1ecc98f
exit



>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102172032.p1HKWE6v090343>