I think I just found a bug in file_proxy.php

rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Wed, 2009-08-19 16:40

Line 122 of file_proxy.php reads:

Quote:
print("Content-Type: $item->mime_type");

I think this should be:

Quote:
header("Content-Type: $item->mime_type");

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Wed, 2009-08-19 17:10

That might explain an issue I've seen and haven't had any time to dig into it, other than this:
http://gallery.menalto.com/node/90075#comment-317202
oops, wrong thread. I'll have to dig that up again...

Yep, confirmed, changing that to header instead of print spits out the image instead of a bunch of garbage if you access the image directly.

But you wouldn't change this too on line 120?

      print("Content-type: image/jpeg");
    } else {
      header("Content-Type: $item->mime_type");
    }

Thanks man!
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Wed, 2009-08-19 17:35
nivekiam wrote:
Yep, confirmed, changing that to header instead of print spits out the image instead of a bunch of garbage if you access the image directly.

Yep, that is the exact issue I was digging into :)

nivekiam wrote:
But you wouldn't change this too on line 120?

The git code I was looking at (see link in the first post) had "header" on line 120 and "print" on line 122. But if your version is different, then yes I would change it to header in both places.

nivekiam wrote:
Thanks man!

No problem :)

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Wed, 2009-08-19 18:54
Quote:
The git code I was looking at (see link in the first post) had "header" on line 120 and "print" on line 122. But if your version is different, then yes I would change it to header in both places.

Ah, yes, I was fast and loose with editing and testing and not paying attention. Only line 122 needs that change.

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
talmdal

Joined: 2006-12-06
Posts: 358
Posted: Thu, 2009-08-20 04:27

Did anyone open a ticket, as I just pushed the change. http://bit.ly/9qOlE
http://www.timalmdal.com

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2009-08-20 04:34

http://github.com/gallery/gallery3/commit/2da7f937840b79b65bacb96e8dad06f2e7d41305
Thanks for reporting!

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Thu, 2009-08-20 04:40

No ticket by me yet. I don't have easy access to sf at work, so I was going to tonight. Guess I won't now.

Thanks.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Thu, 2009-08-20 05:09

I also didn't open a ticket (as I haven't gotten around to setting up an sf account)