I just looked at the headers associated with my problem and here's
what I saw:

----------------------------------------------------------
http://localhost:3000/mugshots/0000/0001/DSCN0925_thumb.jpg?1241031678

GET /mugshots/0000/0001/DSCN0925_thumb.jpg?1241031678 HTTP/1.1
Host: localhost:3000
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; en-US; rv:
1.9.0.10) Gecko/2009042315 Firefox/3.0.10
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://localhost:3000/mugshots
Cookie: _mugshots_session=BAh7CDo...
If-Modified-Since: Wed, 29 Apr 2009 19:01:18 GMT
Cache-Control: max-age=0

HTTP/1.x 200 OK
Last-Modified: Wed, 29 Apr 2009 19:01:18 GMT
Content-Type: image/jpeg
Content-Length: 2780
Connection: keep-alive
Server: thin 1.0.0 codename That's What She Said
----------------------------------------------------------
http://localhost:3000/mugshots/0000/0003/DSCN0913_thumb.JPG?1241031709

GET /mugshots/0000/0003/DSCN0913_thumb.JPG?1241031709 HTTP/1.1
Host: localhost:3000
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; en-US; rv:
1.9.0.10) Gecko/2009042315 Firefox/3.0.10
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://localhost:3000/mugshots
Cookie: _mugshots_session=BAh7CDo...
If-Modified-Since: Wed, 29 Apr 2009 19:01:49 GMT
Cache-Control: max-age=0

HTTP/1.x 200 OK
Last-Modified: Wed, 29 Apr 2009 19:01:49 GMT
Content-Type: text/plain
Content-Length: 4812
Connection: keep-alive
Server: thin 1.0.0 codename That's What She Said
----------------------------------------------------------

NOTE: content_type for .jpg file is image/jpeg
NOTE: content_type for .JPG file is text/plain

Unix file command for these files tells me:
DSCN0913.JPG: JPEG image data, EXIF standard 2.2
DSCN0925.jpg: JPEG image data, EXIF standard 2.2

And Mugshot.find(:all) yields:
>> Mugshot.find(:all)
=> [#<Mugshot id: 1, parent_id: nil, content_type: "image/jpeg",
filename: "DSCN0925.jpg", thumbnail: nil, size: 818302, width: 640,
height: 479, created_at: "2009-04-29 19:01:17", updated_at:
"2009-04-29 19:01:17">, #<Mugshot id: 2, parent_id: 1, content_type:
"image/jpeg", filename: "DSCN0925_thumb.jpg", thumbnail: "thumb",
size: 75300, width: 100, height: 75, created_at: "2009-04-29
19:01:18", updated_at: "2009-04-29 19:01:18">, #<Mugshot id: 3,
parent_id: nil, content_type: "image/jpeg", filename: "DSCN0913.JPG",
thumbnail: nil, size: 833312, width: 640, height: 479, created_at:
"2009-04-29 19:01:48", updated_at: "2009-04-29 19:01:48">, #<Mugshot
id: 4, parent_id: 3, content_type: "image/jpeg", filename:
"DSCN0913_thumb.JPG", thumbnail: "thumb", size: 162513, width: 100,
height: 75, created_at: "2009-04-29 19:01:49", updated_at: "2009-04-29
19:01:49">]
>>

I think there's a dead moth somewhere in this soup...

On Apr 29, 8:17 am, Rick <[email protected]> wrote:
> Yes I agree, my problem is with file extensions and is platform
> specific but I'ld like to understand it so I can get a fix.
>
> So in the time since I wrote the original post, I've done some more
> testing.  I've run now with the following combinations:
>
> Browsers: Firefox (2.0.0.9, 3.0.8, 3.0.10), Safari3.2.1, Opera9.6.4,
> IE5
> Plugins: attachment_fu, paperclip
> Servers: webrick, thin, mongrel (ruby 1.8.7 only)
> Ruby: 1.8.7 and 1.9.2dev
> Rails: 2.3.2
> OS: OSX 10.5.6
>
> The problem is specific to Firefox and displays only when using:
>
> <%= link_to image_tag(photo.public_filename(:thumb)),
> photo.public_filename %>
>
> in attachment_fu, or:
>
> <%= link_to image_tag(@photo.snap.url(:medium)), @photo.snap.url %>
>
> in paperclip.
>
> If the photo is named "photo.jpg" all works as expected.
>
> If the photo is named "photo.JPG" the link image on the from end of
> the link displays correctly even though it's name is something like
> "photo_thumb.JPG".  Following the link however causes firefox to
> request an action to correspond to content type "JPEG Picture".
>
> I've also done a simple test where all actions are local, i.e. from
> file:// rather than http:// locations.  All extensions behave
> correctly.
>
> Anyone out there want to test this out on a different OS? browser?
> server?
>
> On Apr 29, 6:51 am, Anupom <[email protected]> wrote:
>
> > AFAIK according to W3C spec, mime Content-Type header (type/subtype) is not
> > case sensitive. That is, image/jpeg, Image/Jpeg and image/JPEG - all mean
> > the same.
>
> > I agree with Robert, I guess the issue you are having is platform and
> > implementation specific.
>
> > On Wed, Apr 29, 2009 at 8:03 PM, Robert Walker <
>
> > [email protected]> wrote:
>
> > > Rick Lloyd wrote:
> > > > Simply put, I have a view/new... that accepts an image file and uses
> > > > attachment_fu in the model to store the file and thumbnail on the
> > > > filesystem.  The view/index... puts up the thumbnails as "link_to"
> > > > pointing at their respective full size images.  I've been feeding in
> > > > jpeg image files and using rmagick as the image processor.
>
> > > > All works as advertised as long as the filename's type is lowercase.
> > > > i.e.:
> > > >    file.jpg === good
> > > >    file.JPG === bad
>
> > > I'm not completely sure how different browsers treat this, but I do know
> > > this: On many file systems (expecially UNIX based ones) "file.jpg" and
> > > "file.JPG" are different files entirely since the file system itself is
> > > case sensitive.
> > > --
> > > Posted viahttp://www.ruby-forum.com/.
>
> > --
> > Anupomhttp://syamantics.com
>
> > ______________________________
>
> > What are you doing here?? Go Race!!!http://www.mobracer.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to