resize image with send to mail recipient - blurry image

Server 2012 R2 fully patched
XenDesktop 7.9
VMware 6
Outlook 2016

Above is our environment.  When I right click a single or multiple image(s) and select Send to Mail Recipient, I change the Picture size to small 800 x 600, it comes out blurry.  all selections for smaller, small, Medium and Large all come out blurry.  If I select Original size, it is fine.  I have an exact same setup at another client and the images come in clear when I resize the picture to small 800 x 600.

I have checked the win.ini file on both of these set ups and they are the same.  The mail recipient.MAPIMail in the SendTo folder is also the same on both servers.  I have been banging my head on this for a few days now.
accucomAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BillDLCommented:
Would it be possible to attach one of the original images and the same image after it has been resized?
Davis McCarnOwnerCommented:
Ditto on what BillDL is asking for.  Having both would go a long way in helping us to understand and analyze your problem.
And watch out for the problem simply being a printing issue or a screen issue.
800X600 is OK for a 4"X3" print, at best and could look quite blurry on 2K monitor.
accucomAuthor Commented:
Attached is the original picture.  Clear as can be.  Also attached is the resized picture created by right clicking on the original image, selecting send to Mail recipient and changing to 800 x 600.  Did the same thing on a exact 2012 r2 server and the 800 x 600 is clear.  This server is replacing a 2008 r2 server which worked correctly.  Thanks for the help.
original.jpg
resized.jpg
Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

Joe Winograd, Fellow&MVEDeveloperCommented:
> 2012 r2 server and the 800 x 600 is clear

Please post that one, too. Here are properties of the two you posted, which explain why one is clear and the other is fuzzy:

properties
Regards, Joe
accucomAuthor Commented:
attached is the clear 800 x 600 image from an identical 2012 r2 server with xendesktop installed.
resized.jpg
Joe Winograd, Fellow&MVEDeveloperCommented:
Here are the properties on that one:

properties resized clear
The key difference is that it is twice the file size of the fuzzy one. It is probably due to different JPEG compression on the two machines. I don't know where that is set in your environment, but look for a setting for JPG/JPEG compression — when you right-click to select the 800x600 size maybe there's a compression setting that is different in the two environments (remember, JPEG is lossy compression, and the setting can make a huge difference in quality). There may be some other reason for the clear one being twice the file size of the fuzzy one, but I can't think of anything else, as all the normal properties that could make a difference (resolution, size/pixels, color depth, etc.) are the same (and I looked at other properties with five other image viewers besides IrfanView). Regards, Joe
BillDLCommented:
I ran both of the resized images through JPEGsnoop (http://www.impulseadventure.com/photo/jpeg-snoop.html) and the most significant difference is the compression ratio:

Poor quality fuzzy resized image:
Compression Ratio: 30.89:1
Bits per pixel: 0.78:1

Better quality resized image:
Compression Ratio: 15.26:1
Bits per pixel: 1.57:1

For some reason the windows modules used to resize images for emailing on one computer is compressing the image twice as much as the same process on the other.

Whether this is a setting in the registry, or perhaps a different DLL version used by the process is something I don't know and cannot ascertain because I do not have access to Server 2012.  In previous versions of Windows the Send To > Mail Recipient process traditionally called sendmail.dll which actually contains the resize dialog.  It was the same DLL that also allowed you to Send To > Desktop (create shortcut).  This may well have changed with later Windows versions.

If you have a lot of time on your hands you might be able to ascertain what DLLs are called by the process and compare versions using Dependency Walker (http://www.dependencywalker.com).  Server 2012 may already have its own built-in "depends.exe" command.  It came with some Support Tools for previous Windows versions.

Again, if you have time on your hands, you might be able to capture what registry values are accessed when you run the process, and thereby check to see whether there are any compression-related settings in any of the accessed registry values.  You could do this using a utility like process Monitor or Process Explorer:
https://technet.microsoft.com/en-gb/sysinternals/bb795533.aspx

This type of diagnostics is laborious work.

It could simply be that a Windows Update has messed with the files that perform this process on one computer but not the other.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Joe Winograd, Fellow&MVEDeveloperCommented:
> the most significant difference is the compression ratio

Hi Bill,
Thank you for confirming my suspicion that the JPEG compression is different on the two machines. That JPEGsnoop is an awesome tool! I was not aware of it, but it is now in my imaging bag-of-tricks, and a donation to the author is on the way. Really appreciate the heads-up on it! Regards, Joe
accucomAuthor Commented:
thanks for all the help.  I ended up rebuilding the a new server with the same configuration.  I installed software one at a time and tested the sendto feature and so far so good.  They only thing I have not installed are the 140 fonts that are needed for certain users.  I think it may just been a corrupt dll file some how but will not research anymore since I have spent way too much time on this.

Thanks again for all the assistance.
Joe Winograd, Fellow&MVEDeveloperCommented:
You're welcome. Happy to help. And thanks to you for the update. Regards, Joe
Davis McCarnOwnerCommented:
Unfortunately; a wipe and reload is not a fix so delete, please!
Joe Winograd, Fellow&MVEDeveloperCommented:
I disagree with the suggestion to delete. There are some good comments in this thread that an EE member would be well-advised to consider when having a similar problem. In other words, a thread like this should be found in the PAQ when a member searches for such a problem.

I recommend that BillDL's excellent post with a link to the JPEGsnoop tool be the Accepted Solution:
https:#a41754571

I recommend that my post (just prior to Bill's) with the comment that JPEG compression is probably the issue be an Assisted Solution:
#a41752936

As a general comment, I believe we should always think beyond the specific question at hand to a broader audience where other members may have the same, or a similar, problem. When the thread has ideas that will help future situations (such as JPEGsnoop in this case), I think we should not delete the question, even if the specific solution in this one particular instance was something different (such as rebuilding the server in this case).

Just one person's opinion. Regards, Joe
Joe Winograd, Fellow&MVEDeveloperCommented:
Good comments that will help other members who have the same, or a similar, problem.
BillDLCommented:
Thank you Joe
Joe Winograd, Fellow&MVEDeveloperCommented:
You're welcome, Bill — well-deserved!
accucomAuthor Commented:
Ok, thanks for all the help with the issue so far.  Apparently, the rebuild of server fixed the blurry image issue with Send To Mail Recipient but still having a big issue when resizing to the smaller, small or medium size from Send To Mail Recipient.  This has go to be a windows issue as I just built the same XenDesktop 7.9 on a server 2012 r2 running on vCenter with the same Guest parameters and the Send To Mail Recipient works perfectly.  I have attached the original file and also the resized image at small 800 x 600.  I have also attached the resized ph
MH-SQ-251B_Soul-Be-Still-1.jpg
resized-bad.jpg
accucomAuthor Commented:
attached is the same original file that was resized on the another 2012r2 server with XD.  Also, both running on esxi 5.5.
Good-Resized.jpg
Joe Winograd, Fellow&MVEDeveloperCommented:
The original image is 2,467,124 bytes. The "good" resized image is 61,983 bytes; the "bad" is 57,931. In other words, they're both highly compressed, and not a big difference between them. The fantastic tool that Bill introduced us to (JPEGsnoop) says that the compression ratio on the "good" is 17.22:1, while on the "bad" it is 18.61:1 — again, not a big difference between them. In fact, looking at the "good" and "bad" side-by-side, I don't see a difference in the "blurriness", although there's certainly a big difference in the shades of green:

good bad side-by-side
Regards, Joe
accucomAuthor Commented:
thanks Joe.  The blurriness issue was resolved by rebuilding the server from scratch.  Now the issue is resizing and the color after resizing.  Whats crazy is it looks great if you select large or original size, but selecting medium, small or smaller causes the lighter green to show.  It appears it may just affect green and yellow.  My client uses photoshop but insist on being able to right click several images and sent to mail recipient in order to resize as it saves many steps and time.
Joe Winograd, Fellow&MVEDeveloperCommented:
Sorry...misunderstood your comment. So now the issue is color, not blurriness.

> Whats crazy is it looks great if you select large or original size, but selecting medium, small or smaller causes the lighter green to show.

I guess that's because whatever resizing tool it uses is changing the color channels on medium/small/smaller but not on large. I just ran the original through IrfanView and used its feature that allows you to specify the resulting size. I set it at 60KB and it came out to 61,117 bytes and looks fine:

IV-60kb
JPEGsnoop says the compression ratio is 20.80:1. It is not blurry and it is the right color green. I really don't know what to say. Regards, Joe
accucomAuthor Commented:
Thanks Joe,

I am at a loss also.  There isnt much information on the send to feature in windows.  I thought it may be the sendmail.dll in system32.  I compared the registry key with the working 2012 server and all settings are the same.
BillDLCommented:
I am really puzzled by this issue also.

sendmail.dll is certainly the DLL that is called for the Right-Click > Send To > "Desktop (create shortcut)" and "Mail Recipient" options on any Windows system that I have used, however Server 2012 is not one of those.  I cannot imagine that there should be any significant difference in this respect though.

As to the question of what program actually does the resizing, I'm afraid that I do not know whether sendmail.dll does the processing internally or passes it out to another DLL or EXE.

I DO NOT think that the shared Graphics Filters will have any relationship to this.  Microsoft applications like MS Office (and possibly also Windows applications like MS Paint) use shared graphics filters, and from what I can see they are used to import and unencode and also to export and re-encode to different image formats such as would be done when using the "Save As" option and changing the file type.  An example is:
C:\Program Files\Common Files\Microsoft Shared\GRPHFLT\JPEGIM32.FLT
This is the "JPEG Import/Export Graphic Filter" from the 32-bit XP computer I am currently using, so any comparable filters on recent versions of Windows may be in different locations.  There are filters for GIF and PNG in that same folder.

My gut feeling is that these are not used for the resize process that is causing issues on your system as I believe they are installed by (or updated from Windows default by) Microsoft Office, but I suppose it might be worth comparing the versions on the system that resizes with good results and the one that messes up the images.

The most puzzling thing about the two images is that there is so little difference between the file sizes, the compression ratios, and the bits per pixel values, and it is therefore surprising that there should be such a noticeable difference with the colours.  In my experience, downsizing JPG images has never noticeably altered the shades of colour.  Sometimes they lose sharpness, but I have never experienced such a radical colour change.

Increasing JPEG compression will change the image incrementally until too much noticeably degrades it, but normally the colours are not affected as much as the actual quality of the image.  There is always going to be a change in the luminance between the darkest and lightest pixels, and various other changes, but the difference between your two systems is radical.  It is almost as though a JPG with a rich colour range has been re-encoded as a GIF which supports a more limited range of colours, but that is not the case here.   In fact, the "bad" image that is a lighter shade of green contains 68,540 unique colours, and the one with the darker shade of green contains 65,133 unique colours.  The "Bad" image has a wider colour range than the "Good" one !!

Adjusting the "Gamma" values of an image will change the number of unique colours used.  The gamma of an image is a measure of its contrast and brightness.  The gamma curve has three components: red, green, and blue and is represented by a curve.  Where an image has a colour "cast" (eg. yellow due to halogen lighting), gamma adjustments are used to correct this.  By increasing the green, the "good" image can be made to match the "bad" one's green hue without touching the red and blue, and by decreasing only the green the "bad" image can be made to match the hues of the "good" image.  In each case the number of unique colours is either increased or decreased by approximately the same difference as you currently have between your good and bad images.

Whatever function is doing the resizing and resaving is, in my opinion, messing with the gamma and is adding a green colour cast.  I would be curious to see whether a predominantly red image would become a lighter shade of red, and if a predominantly blue image would become a lighter shade of blue by similar degrees as the green one has been affected, or if this is restricted to green only.  I am not saying that I can pin-point the problem or fix it, I am just curious.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2012

From novice to tech pro — start learning today.