Twitter Meta Image Clipping - twitter

When using the meta tags with twitter, does the image need to match their aspect ratio to prevent clipping, or just be larger than their minimum requirements?

For avatars, recommended 400x400px.
For summary cards, images need to match 240x180 ratio, or else they will be cropped, regardless of if you specify image width and height.
For testing cards:
https://cards-dev.twitter.com/validator
I hope this saves someone else all of the time that was wasted on this.

Related

Is there a way to filter iOS Shortcuts photos by aspect ratio?

Is there a way to filter iOS Shortcuts photos by aspect ratio?
I have a Shortcut that finds a random photo after the filter Favorite in the last 12 months is applied. I would like to only have vertically oriented photos but aspect ratio isn't an option. Width and Height are options but the filter doesn't appear to let me compare the two whereby the width is less than the height. Currently I'm using a hard coded less than width which won't work long term if photo resolutions change.
Had the exact same issue:
I worked around this by getting 1 photo result, then using 'Get details of images' to set height and width to variables and comparing them in an if statement. If height bigger than width, set photo as wallpaper and end shortcut.
Wrapped the whole thing, including "Find photos" in "Repeat 20x" so it will iterate until it finds a match.

In GIMP (DBP), how can I batch-resize photos to a certain width and keep aspect ratio?

I have been using GIMP to resize photos one by one, to say 800px-width while keeping aspect ratio. I downloaded the David Batch Processor plugin and everything looks fine, except it isn't able to resize to a predetermined width or height whilst keeping the aspect ratio.
Relative: I can resize by % and keep aspect ratio, but the photos are of different sizes and orientation, so no one % works.
Absolute: There isn't an option to keep aspect ratio, and no one height works for all photos.
Can someone please advise if there is a way to batch-resize photos of different original sizes using GIMP's dbp or there is some other plugin that can work?
I realised that for whatever reason, that Dbp just doesn't have the function to keep the aspect ratio in absolute resizing, so either I write a script from scratch which is an overkill for my purpose or find another plugin for batch processing. I am now using one called Batch Image Manipulation. https://alessandrofrancesconi.it/projects/bimp/

I'd like to ask you how to deal with pictures under the forum, not to distort the picture

Asked friends before, there are several views are as follows:
Let the server return the image size
Set imagview's contentMode
UIViewContentModeScaleToFill This tile is not processed or will be deformed
UIViewContentModeScaleAspectFit This proportionally displayed, too much blank, unsatisfactory
UIViewContentModeScaleAspectFill This is proportionally filled, but this is just the middle part
Download the picture to get the picture size and then change the UI (user experience looks bad)
So would like to ask you how to deal with, there is no one in the case of the picture is not deformed to take the above part of the proportion of full, similar to UIViewContentModeScaleAspectFill? Or is there a better solution?

Force user to crop/upload an image to a certain size? Preferably using filepicker

I have users uploading images using filepicker, but I want them to have to upload an image of a certain size (and crop if the image is too big). I could cut it myself, but then it won't look good. Ideally, the user would crop it themselves.
I've tried this page: https://www.filepicker.com/documentation/file-ingestion/widgets/pick?v=v2 and I've tried various options but nothing seems to work quite well.
data-fp-image-min doesn't prevent users from uploading smaller images. data-fp-crop-force along with data-fp-crop-max and data-fp-crop-min doesn't do the trick either.
I'm open to using other image uploading libraries, but I like using filepicker. Seems like this is something other people would have run into.
I'm using rails btw.
From the docs:
data-fp-image-min - Images smaller than the specified dimensions will be upscaled to the minimum size.
So it doesn't really prevent users from uploading smaller images.
data-fp-crop-max and data-fp-crop-min specifies the maximum and minimum dimensions of the crop area so it won't give you specific dimensions.
I would recommend you to:
Set data-fp-crop-ratio - Specify the crop area height to width ratio. User will be able to adjust the crop area for each photo with desired ratio.
Set data-fp-crop-force="true" - User could not skip cropping image.
Then resize image to specific height or width.
This will result, you will always get the image with the desired dimensions.
Example for 150 x 200 image output:
Html widget:
<input type="filepicker"
data-fp-crop-ratio="3/4"
data-fp-crop-force="true"
mimetype="image/*"
onchange="window.upload(event)"
data-fp-apikey="APUGwDkkSvqNr9Y3KD4tAz" />
Javascript:
window.upload = function(event){
console.log(JSON.stringify(event.fpfile));
var listElem = document.createElement("li");
var image = document.createElement("img");
/*
set w=150 (width) conversion option
so all images would be 150x200
and crop_first option to make sure the image is cropped
before any other conversion parameters are executed.
*/
image.setAttribute('src', event.fpfile.url + '&w=150&crop_first=true');
listElem.appendChild(image);
document.getElementById('results').appendChild(listElem);
};
Here is working solution: http://jsfiddle.net/krystiangw/9o9ebddL/

Sharp UILabel after zooming image

I don't know what to ask exactly. I put a text on an UIImage (with aspect fit content) and save it to album. If saved image is same size as aspect content mode then "text" seems OK. But after zooming in that image, text on that image gets blurred. I want it to be sharp also. Is it possible to do that?
Is it possible to increase pixel count per point? Or What should I do?
Edit: I think I need to increase font size without increasing frame. Is it possible to increase font size (for example from 20 to 50) without changing label's frame size.
Thank you.
If the image is saved as a bitmap, there's not much you can do. The best suggestion I can make is to render it at larger than the target size and save THAT to the photo album. Normally it will be scaled smaller, which looks good. Then when the user zooms in, the text will still be sharp because you will be revealing text rendered at the larger size.
The down-side, of course, is file size and memory footprint. Larger images take more storage, more memory, and more CPU horsepower to display.
I seriously doubt if the iOS photo album supports any vector formats (PDF, illustrator, etc.) If they did that would be another possibility, but like I said, probably not.

Resources