Crystal Reports Can Grow option for picture object - image

I've got a crystal report built from v. 14.0.
Inside the report I've got a picture object that I've set the scaling properties to 33%.
The graphic location is set to pull from our DB.
I have two different images that I need displayed there depending on parameters passed into the report.
They are both 300 DPI, 1950 x 319.
Of both images, one pulls in wrong. It seems like it's scaling to 33% OF whatever 33% of the original image size is. Basically looks like 1/3 of what it should look like.
The other image pulls in exactly how it should look # 33% scaled.
The scaling doesn't change in the picture object properties when each image is loaded, it stays # 33%. If I change the one that comes in wrong to 100% scaled, then it looks correct which is weird, because # 100% it should be way bigger.
I've tried copying the bad image into the good image and resaving but the same thing happens, the scaling gets set wrong.
I can't figure out what's different about the images that's causing this weird behavior.
I've tried saving the images to bmp format but the same thing continues to happen. I've saved the images with multiple versions of photoshop and still nothing changes.
Is anyone able to point me in the right direction here? Thank you.

After much research we've identified something in the exif info that is causing this issue.
There's a block in the image that doesn't work called app0 that contains the jpg file interchange format information. I don't know a whole lot about it other than we used an app called photostudio.exe to look at the exif info.
We then used a tool called exiftool to remove that block from the exif info.
After doing so, the image scaled perfectly to 33%.
It's almost as if Crystal is scaling, then looking at that first app0 exif block and failing, then scaling again (effectively just retrying their method), and looking at the next blocks without failing any further.

Related

Image size guidelines

This may well be a little of an open-ended question
The site I am working on requires to be optimised for performance. One of the key areas is to optimise the file sizes of the images used upon the site.
Unfortunatley these images are being created by employees who do not have the required knowledge for creating images for the web, and it is my job to produce a set of guidelines for them to use.
I was wondering whether there was any resource/guidlines/literature regarding typical images file sizes for images of different dimensions - as I would like to include something like this to aid them to ensure their images are being created properly.
Any info would be greatly appreciated.
Thanks in advance
I can't answer the opinion question, but I can suggest some guidelines that will keep your images smaller.
First off, if they're using Photoshop to edit their images, it's likely they're storing a whole bunch of crap in the headers (digital papertrail, EXIF data, and such). Also, folks will frequently save in too high a bit depth.
For novice users, trying to explain why they need to use "save for web" is more likely to confuse them. Instead, just point them at:
http://www.smushit.com/ysmush.it/
This site is rather handy - it will compress all the images on a page you specify, or you can upload the images.
You should strongly consider writing some guidelines about where images are stored as well. It's frequently very beneficial to have your static image content stored on several servers, apart from your dynamic content. Most browsers will only download a limited # of files at a time from any given website (usually it's 2).
Unless there's a good reason, all your images should be cached using one of the HTTP cache techniques (expires, etags, etc).
Good luck.
72 dpi as a resolution and either jpeg or png formats work best.
Try to use images at the exact pixel area size they will end up being displayed as. This is specified by the images height and width attributes.
You can set the output quality of a jpeg image which will also save file size although there is a trade off against image quality.
I hope this is of use.

crystal reports image squashed

Is there any way in Crystal Reports(v11, if this matters) to prevent the images from stretching itself to fit in the whole OLE-object? I'm loading the images dynamically from a database and don't know their aspect ratio.
Thanks for help.
i found the answer here
To make the image resize properly, you must perform the following steps in order:
Set the image's EnableCanGrow to true
Calculate and set Width and Height to the needed size
Set the image's EnableCanGrow to false
Fill the DataSet's image object with data
Continue with normal report processing.
If you get these items in the wrong order, or skip an item, you will
find that Crystal Reports scales the image in unexpected and unrecoverable ways.
The Crystal OLE object, which shows pictures from files, can only be set programmatically so for a 'pull' type report, where you are supplying a dynamic image name, of either portrait or landscape orientation, at least one of those orientations will get squashed to fit. It is better, IMHO, to show thumbnails and then have a calculated hyperlink to show the real picture in some decent viewer. You will spend an unreasonable amount of time trying to get the OLE object that shows pictures to understand that your image has a different aspect ratio. As long as it is at least reasonably legible that may have to suffice.
I don't think Crystal can help you. Try looking for some kind of command-line based app on the internet which can automically resize pictures (add black space, reduce in a 1:1 ratio, etc). I'm sure they're out there.

CGImageGetWidth returns different size then actual image

Hi i have a lot of image reading in my app and when I load the files i use
CGImageGetWidth and CGImageGetHeight to get the sizes of the images.
However this does not seem to return the right values all the time.
For example if I have an image whose size is 114x14, these functions will return 126x22 or something random like that.
The really odd part is that it doesn't happen all the time(changes from build to build) but it tends to happen to the same group of images.
So either i have some kind of coding error that i am not aware of or the images have some setting to them that makes them handle differently.
Anybody know of what could possibly cause this kind of behavior?
Thanks
Check the resolution of the image. Some image formats allow for a pixels-per-inch of something other than the standard 72 pixels per inch.

Very large images in web browser

We would like to display very large (50mb plus) images in Internet Explorer. We would like to avoid compression as compression algorithms are not what CSI would have us believe that they are and the resulting files are too lossy.
As a result, we have come up with two options: Silverlight Deep Zoom or a Flash based solution (such as Zoomify). The issue is that both of these require conversion to a tiled output and/or conversion to a specific file type (Zoomify supports a single proprietary file type, PFF).
What we are wondering is if a solution exists which will allow us to view the image without a conversion before hand.
PS: I know that you can write an application to tile the images (as needed or after the load process) and output them; however, we would like to do this without chopping up the file.
The tiled approach really is the right way to do it.
Your users don't want to download a 50mb file before they can start viewing the image. You don't want to spend the bandwidth to serve 50 megs to every user who might only view a fraction of your image.
If you serve the whole file, users will eventually be able to load and view it, but it won't run smoothly for most of them.
There is no simple non-tiled way to serve just a portion of an image unless you want to use a server-side library like imagemagik or PIL to extract a specific subset of the image for each user. You probably don't want to do that because it will place a significant load on your server.
Alternatively, you might use something like google's map tool to provide zooming and scaling. Some comments on doing that are available here:
http://webtide.wordpress.com/2008/08/27/custom-google-maps/
Take a look at OpenSeadragon. To make a image can work with OpenSeadragon, you should generate a zoomable image format which mentioned here. Then follow starting guide here
The browser isn't going to smoothly load a 50 meg file; if you don't chop it up, there's no reasonable way to make it not lag.
If you dont want to tile, you could have the server open the file and render a screen sized view of the image for display in the browser at the particular zoom resolution requested. This way you arent sending 50 meg files across the line when someone only wants to get an overview of the image. That is, the browser requests a set of coordinates and an output size in pixels, the server opens the larger image and creates a smaller image that fits the desired view, and sends that back to the web browser.
As far as compression, you say its too lossy, but if thats what you are seeing you are probably using the wrong compression algorithm or setting for the type of image you have. The jpg format has quality settings to control lossiness, and PNG compression is lossless (the pixels you get after decompressing are the exact values you had prior to compression). So consider changing what you are using as compression, and dont just rely on the default settings in an image editor.

importing .png image into flash CS3

While importing a .png file in Flash CS3, i noticed that it automatically gets resized. It gets imported smaller than its original size. Im importing it to the stage and not inside any symbol. Can anyone explain why this happens? Do i have to change any settings to get the original size as it is?
this is happening because the resolution of your png is greater than 72.
you can verify the resolution of your image in photoshop by going to the menu bar and image-->image size-->resolution.
change the resolution to 72, and make sure 'resample image' is unchecked. That is, you want to maintain the pixel dimensions of your image while downsizing the resolution.
Flash is thinking you've brought in something at 72 (as that's all it understands) and thus is rescaling it on the fly.
You mean just file-> import in Flash? Or programmatically importing it?
The first question doesn't belong on SO. For the second question we need more information to be able to help you.

Resources