From mboxrd@z Thu Jan 1 00:00:00 1970 From: ape at ape3000.com (Lauri Niskanen) Date: Thu, 01 Mar 2012 11:56:15 +0200 Subject: Image blobs should be printed as images instead of hexdumps In-Reply-To: <4F4E0E72.5020906@hupie.com> References: <4F4E0C42.70007@ape3000.com> <4F4E0E72.5020906@hupie.com> Message-ID: <4F4F47BF.8000601@ape3000.com> On 29/02/12 13:39, Ferry Huberts wrote: > > > On 29-02-12 12:30, Lauri Niskanen wrote: >> Hi! >> >> Cgit currently prints a hexdump when you look at a image blob (as with >> any other binary blob). This might be a good way to show generic binary >> files, but I think images (at least png, jpg) should be shown as images. >> >> Example of the current behaviour: >> http://hjemli.net/git/cgit/tree/cgit.png >> >> I suggest that instead of the hexdump you would have HTML like this: >> >> >> SVG images are not binaric so I would leave them printed as text. >> >> What do you think about this? >> > > > This is kind-of solved by my mime patch that's on wip. > Once Lars merges that into stable, you'll have it > > http://hjemli.net/git/cgit/commit/?h=wip&id=d01c600c179593a53162a9d4e3040ecfc5078fdc > > > > From what I understood from Lars is that files should always be shown > within cgit (non-plain) first, because some sites want to disable the > viewing of plain files. Thanks, but how does that patch solve my problem? Yeah, we probably need the mimetype information so that we know which files are images, but I don't see any code that would show images as -tags instead of a hexdump. -- Ape