Images uploaded are blank

Jan 27, 2011 at 5:40 PM

I have been trying to use the Image Field. When I create a new content type, and try to upload an Image, it creates a file in the Media folder, but when you go to view the image it is blank or white.

Jan 27, 2011 at 5:47 PM

Can you give some repro steps, I have just tried it and it's working fine.

Jan 27, 2011 at 5:56 PM

Sure, here are the steps I took.

1) Install ImageField Module through gallery.
2) Enable ImageField in the features.
3) Create a new Content Type with a field based on the ImageField
4) Create a new Content Item based on the Content Type with the ImageField, and selected a jpeg. I used one that was less than 200 x 200 pixels in size. It was about 8K in file size.
5) View the new Content Item.

The result for me was an image file was created in the Media folder on my website, but the image itself shows up white. I can supply the image if you want to use it for testing.


Jan 28, 2011 at 9:14 PM

I have the same issue, also.  And I believe I know what's going on.

The image shows up in the Media/Default/images/avatars folder (the bolded part is what I configured).
If I try to view the actual saved image from the server, it's all black.  The image I uploaded is png file.

In the profile page, I can tell that there's an img field there with the correct URL.  But I believe because the actual saved image is not correctly saved, it's not showing up in the page.

Feb 1, 2011 at 3:09 PM

Same issue for me. With no additional configurations. Empty images are stored on server side

Feb 1, 2011 at 6:49 PM

I've actually replicated the issue in debug.  I should be able to provide a fix for this soon.

The question now is if the Coordinator for this project (Sebastien) is watching this discussion to facilitate the distribution of the fix.

Feb 1, 2011 at 6:53 PM

I do follow the discussions, but was occupied with the standard Orchard work ...
If you can patch the module, fine, I would accept the push request, and republish on the gallery.


Feb 1, 2011 at 6:54 PM

Awesome thank you very much!  I should have a fix very soon.  Would you prefer a fork or an update to tip?

Feb 1, 2011 at 6:57 PM

A fork is nice, I just need to push a button ... and I know when it's ready

Feb 1, 2011 at 7:49 PM

Fixed.  BlankImageFix fork.


Feb 1, 2011 at 9:43 PM

After some investigations, your fix was not fixing the good issue. So I patched it by myself. Sorry for the time you spent on it.
It's also on the gallery.


Feb 1, 2011 at 10:25 PM

It appears all you did was move the graphics block inside the case statements instead of keeping it outside and actually assigns the target variable.

Your change is logically the same as mine.  But it doesn't matter, as long as your code is fixed.

Feb 1, 2011 at 10:53 PM

I just installed it and ran into problems with the module not upgrading to 0.9.

So, I deleted the module from my server and re-installed and everything is working now.  Thank you!

Feb 11, 2011 at 6:19 PM

This must be the same problem I ran into and posted on the issue tracker last night. I thought I was using the latest code though so I don't know how if it was fixed here I was still running into the problem. The problem I found had to do with the original memory stream used to read the bytes into an image file was disposed by the time the last Save was called which caused it to have a generic GDI+ exception, which is well documented as a problem I found on google.

Apr 8, 2011 at 3:17 PM

I solved this issue (GDI+ exception). Just change lines 149, 163

target = image;


target = new Bitmap(image);

I'm waiting new version of your great module. :) Thanks!