List for cgit developers and users
 help / color / mirror / Atom feed
* Image blobs should be printed as images instead of hexdumps
@ 2012-02-29 11:30 ape
  2012-02-29 11:39 ` mailings
  0 siblings, 1 reply; 6+ messages in thread
From: ape @ 2012-02-29 11:30 UTC (permalink / raw)


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:
	<img src="http://hjemli.net/git/cgit/plain/cgit.png" />

SVG images are not binaric so I would leave them printed as text.

What do you think about this?

-- 
Ape <Lauri Niskanen>




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

* Image blobs should be printed as images instead of hexdumps
  2012-02-29 11:30 Image blobs should be printed as images instead of hexdumps ape
@ 2012-02-29 11:39 ` mailings
  2012-03-01  9:56   ` ape
  0 siblings, 1 reply; 6+ messages in thread
From: mailings @ 2012-02-29 11:39 UTC (permalink / raw)




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:
> <img src="http://hjemli.net/git/cgit/plain/cgit.png" />
>
> 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.

-- 
Ferry Huberts




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

* Image blobs should be printed as images instead of hexdumps
  2012-02-29 11:39 ` mailings
@ 2012-03-01  9:56   ` ape
  2012-03-01 13:34     ` mailings
  0 siblings, 1 reply; 6+ messages in thread
From: ape @ 2012-03-01  9:56 UTC (permalink / raw)


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:
>> <img src="http://hjemli.net/git/cgit/plain/cgit.png" />
>>
>> 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 <img>-tags instead of a 
hexdump.

-- 
Ape <Lauri Niskanen>




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

* Image blobs should be printed as images instead of hexdumps
  2012-03-01  9:56   ` ape
@ 2012-03-01 13:34     ` mailings
  2012-03-01 15:20       ` ape
  0 siblings, 1 reply; 6+ messages in thread
From: mailings @ 2012-03-01 13:34 UTC (permalink / raw)




On 01-03-12 10:56, Lauri Niskanen wrote:
> 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:
>>> <img src="http://hjemli.net/git/cgit/plain/cgit.png" />
>>>
>>> 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 <img>-tags instead of a
> hexdump.
>


from the page you mention, you can click the 'plain' link (if it's enabled).

That will send the file to you with the most appropriate mime-type.

-- 
Ferry Huberts




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

* Image blobs should be printed as images instead of hexdumps
  2012-03-01 13:34     ` mailings
@ 2012-03-01 15:20       ` ape
  2012-03-01 15:53         ` mailings
  0 siblings, 1 reply; 6+ messages in thread
From: ape @ 2012-03-01 15:20 UTC (permalink / raw)


On 01/03/12 15:34, Ferry Huberts wrote:
 > On 01-03-12 10:56, Lauri Niskanen wrote:
 >> 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:
 >>>> <img src="http://hjemli.net/git/cgit/plain/cgit.png" />
 >>>>
 >>>> 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 <img>-tags instead of a
 >> hexdump.
 >>
 >
 >
 > from the page you mention, you can click the 'plain' link (if it's
 > enabled).
 >
 > That will send the file to you with the most appropriate mime-type.

Yeah. I've been using that, and it works just fine. But I really wanted 
something like this:
   http://x.ape3000.com/projects/cgit/cgit.png.htm

instead of this:
   http://hjemli.net/git/cgit/tree/cgit.png

There would be two main benefits from this. Firstly, it would be easier 
and faster to look at the actual image. Secondly, there would be a 
reason for not generating and showing a hexdump. The hexdump for an 
image seems to be mostly useless, and most people want to see the image 
when they click the file on the tree view.

Just to give more examples, I think GitHub has managed to solve this 
quite nicely:
   https://github.com/metajack/cgit/blob/master/cgit.png

-- 
Ape <Lauri Niskanen>




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

* Image blobs should be printed as images instead of hexdumps
  2012-03-01 15:20       ` ape
@ 2012-03-01 15:53         ` mailings
  0 siblings, 0 replies; 6+ messages in thread
From: mailings @ 2012-03-01 15:53 UTC (permalink / raw)




On 01-03-12 16:20, Lauri Niskanen wrote:
> On 01/03/12 15:34, Ferry Huberts wrote:
>  > On 01-03-12 10:56, Lauri Niskanen wrote:
>  >> 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:
>  >>>> <img src="http://hjemli.net/git/cgit/plain/cgit.png" />
>  >>>>
>  >>>> 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 <img>-tags instead of a
>  >> hexdump.
>  >>
>  >
>  >
>  > from the page you mention, you can click the 'plain' link (if it's
>  > enabled).
>  >
>  > That will send the file to you with the most appropriate mime-type.
>
> Yeah. I've been using that, and it works just fine. But I really wanted
> something like this:
> http://x.ape3000.com/projects/cgit/cgit.png.htm
>
> instead of this:
> http://hjemli.net/git/cgit/tree/cgit.png
>
> There would be two main benefits from this. Firstly, it would be easier
> and faster to look at the actual image. Secondly, there would be a
> reason for not generating and showing a hexdump. The hexdump for an
> image seems to be mostly useless, and most people want to see the image
> when they click the file on the tree view.
>
> Just to give more examples, I think GitHub has managed to solve this
> quite nicely:
> https://github.com/metajack/cgit/blob/master/cgit.png
>


patches welcome ;-)

-- 
Ferry Huberts




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

end of thread, other threads:[~2012-03-01 15:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-29 11:30 Image blobs should be printed as images instead of hexdumps ape
2012-02-29 11:39 ` mailings
2012-03-01  9:56   ` ape
2012-03-01 13:34     ` mailings
2012-03-01 15:20       ` ape
2012-03-01 15:53         ` mailings

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).