Metadata extractor: Is the exif tag 'orientation' respected when calculating image width and height? - metadata-extractor

I want to use the metadata-extractor Java Library version 2.18 to extract metadata from images. Does the library respect the orientation Exif tag on the calculation of the image width and height of an image?

The library will provide you access to all three values: width, height, orientation. You can do with them as you wish.
If you think there'd be a generally useful helper function that we could add to the library to make this easier to get right, we would consider a pull request, depending upon the proposed API.

Related

how to scale an image with gimp and save the actual scale and all the white space

there are a ton of scaling instructions for GIMP but all of them tell you to scale and save easy peasy. I feel like I'm taking crazy pills.
This is what my save or export generates:
How can I simply export a selection? Shouldn't the GIMP instructions include this detail? Sorry for ranting.
In Gimp (and some other popular image editors) the image you work on is actually made of separate images (a.ka.a layers) held together on a "canvas". The "canvas" gives the size of the final image.
There are three different ways to scale things and you have to use the right one:
The Scale tool : scales the active layer by dragging corners. Doesn't change the size of the canvas. This is probably what you used.
Layer>Scale layer: scales the active layer by providing explicit dimensions. Doesn't change the size of the canvas.
Image>Scale image: scales the whole image contents and the canvas. This is probably what you should have used.
What happened to give you the image above is that you resized the layer using the Scale tool, so you got a tiny image in the corner of the canvas, which didn't change size. The uncovered part of the canvas was displayed as a checkerboard pattern. If you exported to a format that supports transparency such as PNG or GIF the image would have been transparent, but since you exported to JPG which doesn't support transparent images Gimp replaced the transparent part by the default background color.
Everything is well explained on their website. https://www.gimp.org/tutorials/GIMP_Quickies/

Tagging dimensions and name on image codename one

I have an image( mechanical part of machine ) in my form in which I have to put some measurement like width and height, show arrows for inlet and outlet on image and display name near by each component. How do I proceed for this ?
Note : Width and height come from user as input, so all these dimension depends on user. Basically user will try to design a feasible model based on some calculations. These parameters need to be displayed on image.
If I understand the question correctly you are trying to draw on an image.
For that just create an Image using Image.createImage(width, height, ARGB_COLOR) that would generate a "mutable image" which means you can draw on it by invoking getGraphics() on the image and using the graphics to draw whatever you want (including other images). You can then save the image to a file using the ImageIO class.

Image resolution and size in mobile apps

I use monogame. Currently, I have a problem that prevents me to advance. this problem is concerning the image resolution and size to use.
What I want to know is Can I use the same images or I must use different images (Background images whish fill all the screen) for each device according to the resolution and/or the size of the screen.
Thank you in advance.
You can use just one image and scale it to fit the desired resolution. The simplest way to do a background image is to use the SpriteBatch.Draw overload that takes a destination rectangle like so:
var width = _graphicsDeviceManager.PreferredBackBufferWidth;
var height = _graphicsDeviceManager.PreferredBackBufferHeight;
var destinationRectangle = new Rectangle(0, 0, width, height);
_spriteBatch.Begin();
_spriteBatch.Draw(_backgroundTexture, destinationRectangle, null, Color.White);
// draw other sprites here
_spriteBatch.End();
Keep in mind that your images are going to look better if you are scaling them down rather than up, so make them fairly large so they look good on tablets as well as phones. I tend to use 1600x960 because it's twice the size of a common phone resolution 800x480.
The other thing to consider is that the image may with stretch into a different aspect ratio on some screens. In my opinion, this is okay most of the time, but you may want to implement a more sophisticated scaling system. Some people like to use Pillarboxing, Letterboxing or simply cut off the sides in a non-widescreen (not sure what this is called).
Alternately, you could use different images for different resolutions for a higher quality result. Although, I haven't seen this approach used much in games but I think it's pretty common in apps.
you must use diffrent image for each resolution, and put images of the same resolution in one folder to order your code.

Store large image

I'm looking for a way to store a very large image (e.g. 100.000x100.000 pixels) on a webserver. I must be able to retrieve parts of that image and write parts into it. The cherry on top would be a way to get parts of that image, resized to a specific resolution (for example, i want alle pixels from 0,0 to 10.000,10.000 resized to 1000x1000 pixels).
Anybody know a kind of DB, or a data-structure or any other way or service or programm that can handle something like that?
thx, tux
How about Tiles?
Just like what popular mapping application (Google Maps / Bing Maps ) does. Divide and pre-process your image in to tiles for various sizes (zoom levels). Display them on a webpage with zero margin, zero border.
While retrieving, calculate positioning of tiles (which tiles should be retrieved as whole and which ones as partial) and then return as single image.
http://143.117.54.5/idl/images/img_pyrm.gif
(image ack: http://143.117.54.5/idl/Image_Tiling.html)
Search for "map servers": there are a bunch of them already available. I'm sure they at least contain components that might be of interest for you.

App Engine image resize without maintaining aspect ratio?

When I call resize on images using app engine, they maintain their aspect ratio - I don't end up with the size I ask for.
I'm trying to make rectangular pixel NTSC images from square pixel sources, so I don't want this behaviour
I want to take an image that is 720x540 and resize it to 720x480 but what I actually end up when ask for the resize is an image that is 640x480.
Is there any way round this?
Alas, while PIL per se could do it, that's not what App Engine's very simple images functionality is using (you may be confused by the fact that the SDK is indeed using PIL to implement that functionality's API on your development machine) -- in particular, resize always does respect the aspect ratio. Your chance to get higher functionality depends on asking for it on app engine's issue tracker, and hoping that many developers have that need!
Are you giving the resize method both a width and a height?
http://code.google.com/appengine/docs/python/images/functions.html
Adam McGrath wrote a great rescale function that crops an image to a specific width and height in his answer here.
Why not use the crop function?
The correct arguments to transform a 720x540 to a 720x480 image would be (presuming you want a center crop):
crop(bytestream, 0, 0.055, 1, 0.945, output)
The crop function takes its arguments as a proportion of the image width or height, specified as a float value from 0.0 to 1.0.

Resources