Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm getting an Out of memory error on a relatviely small image - 630KB
Using version 18.104.22.16853
Can you tell us a bit about the server your Umbraco installation is hosted on? Is it only this image it's happening with or does it happen with other images created after this one as well?
Learn something new every day... the image you are using is JPG with a CMYK colorspace. Didn't know that was even possible in JPG (indeed, it might actually be a JPEG2000 format and I'll look more closely into that). That's the origin of the problem. I'll add that as a feature request in a future version. Apologies the error message wasn't clearer on that point, I'll update that too.
Hmmm. Just ran some tests with your image... it works just fine here and I am no longer sure it is a cmyk issue.
Since I can't reproduce the problem, I wonder if you could post your imagegen.config file information, particularly for the classes? Perhaps there's a combination of features that is causing the problem.
I haven't changed the default settings in the config file.
Any chance you're running on Win2008 R2 or Win7? There seems to be a .net issue when using cmyk jpegs on those platforms and I can reproduce the problem on Win7 but not on "lesser" versions such as XP, which renders the image perfectly.
Good detective work. Yes, running Win Web Server 2008 R2.
Okay, then I know the origin of hte problem (it's a .net/windows bug) and I can reproduce it! :)
FWIW, it is related to cmyk jpegs, but not because of my code but because of the .net/windows bug. Looking for a solution now. Hope to have a fix for you to test soon. Probably Wednesday.
I believe I have a fix and will release it tomorrow as ImageGen 2.5.3.
@Dan, can you contact me through my website and let me know your email address so I can send it to you for testing on your site before making it a public release? http://www.percipientstudios.com/about/contact.aspx
Just checking you got my contact details?
Yes that fixed it!
Is the 2.5.3 version released?
Doug, I have the same question - I'm pretty sure I'm seeing the same problem, having just moved a previously-ok site to a new Win2k8R2 server.
For the record, 2.5.4 definately fixes this problem; I upgraded the affected site this morning, and all is good again. Thanks Doug!
Where to download from?
A beta of ImageGen 2.5.4 that patches the 'CMYK JPEG out of memory' problem is now available for download at http://our.umbraco.org/projects/website-utilities/imagegen
Thanks for this Doug.
I've uploaded the new dll but I now get this error 'Requested image path is not allowed. (/Upload/bow/b9b1069b-507c-4a80-a544-93a012007c00.jpg)'
url looks like:
@Skiltz - sorry, you're right. If you put the imagegen.ashx file in the root of the site (rather than in the old location of buried in the umbraco folder) it'll work. Having /imagegen.ashx is the new location and there's a bug in the beta patch that wrongly doesn't handle it being anywhere else. That'll be fixed for the final release.
I have the exact same issue which is causing very big problems. Can someone supply me the fix or help?
Go grab the beta-patchhttp://our.umbraco.org/projects/website-utilities/imagegen
It worked for me.
Just tried ImageGen.22.214.171.124302-beta-update.zip and ImageGen_2.5.7.zip, but I still get an out of memory exception on random small images. Running on Win7. Is there any way I can get more debug info about what could cause the exception?
Just read this topic: http://our.umbraco.org/projects/website-utilities/imagegen/imagegen-bugs/29675-One-specific-image-wont-show-in-one-specific-widthq?p=0#comment110558
It doesn't seem related, but after I add format=jpg to my images (they were jpeg) I don't get the out of memory exception anymore.
Hmm looks like format=jpg only works when the images have a relative path. If the image has a full path I still get out of memory exceptions.
Hmm still getting out of memory exceptions randomly only not as much as before :(.
@Jeroen - what happens if you use a newer version of ImageGen, say 2.5.7?
If you still get problems, can you let me know a URL where I can see the problem on the site? Email me if it's not a public url.
I already tried 2.5.7, but that gives the same problems. Currently the website only runs local on my pc so I can't show it yet. Do you perhaps have a version which can show more info like a stack trace instead of only "out of memory"? Thanks.
I'm using NopCommerce 1.90 and there images which are uploaded as .jpg are stored as .jpeg on the file system. Could that cause any problems?
Is there any way I can get more info about this problem? I'm running on win7 and the website I'm working on can't go live until this is fixed.
The error message is simply being passed along by ImageGen from .net / the OS. It really means what it says. The question is, why? Especially with small images. And more interestingly, with random images.
You'll have to tell me more about what's going on. If there were an image or two that consistently gave a problem that would be great, but it doesn't sound like that's the case so reproducing the issue may be a challenge.
You can help with some tests. First, use the &nocache=true flag for a while. That will force ImageGen to ignore any already-cached version and always re-create the image you request. It'll make a performance hit but will have two side effects of interest. First, it should make any memory condition more evident since ImageGen will be using cpu/memory for every request to resize the original images rather than just serving from already-cached versions. So hopefully the problem will happen more often. Second, there won't be a chance of somehow caching a bad image and then serving it again on repeated requests. In other words, we will see exactly what's going on with each image on every request.
Other things to consider... while your computer may have lots of memory, is your site's application pool limited in memory? Also, are the images you are working with local or remote?
I've had a couple of emails with Doug and we still don't know how to fix the problem. I created a new website and added ImageGen and the images in it and I can still reproduce the problem in there. You can download it here. Open the solution, run default.aspx and refresh a couple of times to see the error. Doug already did some tests. Here is a part of the email:
Here is my reaction:
Does anyone have an idea what could be the problem and how to fix it? Thanks!
Is the ImageGen library open source? I've actually written a couple of libraries for this very purpose and have experience in imaging, I could possibly have something to contribute - obviously it will take a bit of digging, as you guys have discovered.
ImageGen is not open source. If you want to contribute something you'll have to ask Doug.
Well, my previous post should let him know where I stand. Feel free to catch up with me, Doug.
I would suspect the image's format to be causing this.. There's so many ways to "corrupt" images, especially those that are generated from a DB.
Not sure if its possible, but you could try and replace the images with some copies that haven't been generated by nopCommerce and see if the problem still occurs.
To reproduce the error you can just write a quick script that fires requests to the default.aspx.
Of course, that would only verify if the images are somehow corrupt, not really a solution tho.
This is most likely a threading issue within ImageGen. I have just emailed Doug with the following:-
I'm using ImageGen basic for a client project but I'm getting out of memory errors. This happens across all types of jpg images.
I find that it's reproducible when I use Fiddler2 and request the same image multiple times simultaneously, which would indicate to me it's some kind of threading issue (e.g. accessing the File with a Read lock which may prevent another thread from Reading the file).
I just tested accessing the URL sequentially 9 times in a row and no errors occurred, however, if I select all those requests in Fiddler2 and hit Replay > Reissue Requests, then the error occurs 2 out of the 9 times.
The query string is:?image=/media/profiles/1.jpg&AltImage=/images/profile.png&constrain=true&width=160&nocache=true
The error response is:HTTP/1.1 200 OKCache-Control: privateContent-Type: text/html; charset=utf-8Vary: Accept-EncodingServer: Microsoft-IIS/7.5Date: Fri, 20 Jul 2012 12:54:21 GMTContent-Length: 14
Out of memory.
Maybe if other people could also test their installations with Fiddler (sequential access vs parallel requests) then we can get to the bottom of this.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted