The images I’m saving are less than 100kb and easily handled by my
mysql column of db_file.data which is declared MEDIUMBLOB.
My problem is that the view works perfectly in production but not at
all in development – in development I just get a broken image graphic
with a box and a red x.
Any ideas on how to troubleshoot this? Since it doesn’t seem to be my
code (it works fine in production) I’m at a loss on how to figure this
out.
Thanks for the suggestion –
I get the same red box with the x.
Do the logs indicate that an error occured ? If not and if you use the
tool of your choice to download the image, how do the bytes differ
from the bytes you would expect.
logs say that all is ok:
Sending data my_image.jpg
Completed in 0.09400 (10 reqs/sec) | Rendering: 0.00000 (0%) | DB:
0.08000 (85%) | 200 OK [http://localhost/photo/get_image/5]
Interesting question you ask about how do the bytes differ. I guess I
first need to find a “tool of my choice” other than my two browsers
(IE and Firefox) – any suggestions?
i guess that’s the point in that the browser is not displaying the
image – it is just displaying the error gif, ie, a box with a red x
in it indicating that i can’t load the image.
Fred, i really appreciate the time you’re dedicating here…
Just tried something else –
Changed disposition to “attachment” and used Firefox to successfully
download the file. When I tried to open the file (in GIMP) I received
these error messages:
– Premature end of JPEG file
– Invalid JPEG file structure: missing SOS marker
So, I guess attachment_fu is not saving the files properly to my
db_file table…
logs say that all is ok:
Sending data my_image.jpg
Completed in 0.09400 (10 reqs/sec) | Rendering: 0.00000 (0%) | DB:
0.08000 (85%) | 200 OK [http://localhost/photo/get_image/5]
Interesting question you ask about how do the bytes differ. I guess I
first need to find a “tool of my choice” other than my two browsers
(IE and Firefox) – any suggestions?
using the browser to save the image to disk would be one way.
Yes – seems like attachment_fu or mysql (?) might be truncating.
Weird though as the file size is not very large – just 10kb. In my
experience, truncation occurs because you are handling large files…
Just tried something else –
Changed disposition to “attachment” and used Firefox to successfully
download the file. When I tried to open the file (in GIMP) I received
these error messages:
– Premature end of JPEG file
– Invalid JPEG file structure: missing SOS marker
So, I guess attachment_fu is not saving the files properly to my
db_file table…
Yes – seems like attachment_fu or mysql (?) might be truncating.
Weird though as the file size is not very large – just 10kb. In my
experience, truncation occurs because you are handling large files…
I suppose you need to pinpoint where it happens: before the image hit
your app, before attachment fu tried to save it, when mysql was given
the image, after retrieval from the database etc…