image-size

Scale image according a maximum file size

核能气质少年 提交于 2019-11-30 09:51:45
问题 I'm using Imagick and like to scale an image to a maximum file size of 2.5MB I had a look to this SOF question: ImageMagick: scale JPEG image with a maximum file-size which is exactly what I want to do but the extent() method from Imagick does not have the size parameter: http://www.php.net/manual/en/imagick.extentimage.php Anyone knows how I could to it? At the moment I'm trying to calculate a coefficient between the original file size and the target file size to calculate a new resolution

FB debugger says that my og:image should be larger, even though it is large

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 07:47:58
问题 Check out this result of debugging an article using Facebook debugger. It comes up with this warning: og:image should be larger. Provided og:image is not big enough. Please use an image that's at least 200x200 and preferably 1500x1500. But if you open the image displayed in the "og:image"-field below, you can clearly see that the image is big enough - 700x350 px. This results in Facebook picking random images when I'm publishing articles on my wall. Any idea why this happens? Edit: Could the

Get image height and width PHP

怎甘沉沦 提交于 2019-11-30 06:55:56
Hello I need to get the height and width on the fly of an uploaded image. This is the PHP function I am using, but it does not return anything for the width and height.. Could you please help me? list($width, $height, $type, $attr) = getimagesize($_FILES["Artwork"]); $min_width = "1000"; $min_height = "1000"; if ((($_FILES["Artwork"]["type"] == "image/gif") || ($_FILES["Artwork"]["type"] == "image/jpeg") || ($_FILES["Artwork"]["type"] == "image/jpg") || ($_FILES["Artwork"]["type"] == "image/pjpeg")) && ($_FILES["Artwork"]["size"] < 20000000) && ($width > $min_width) && ($height > $min_height)

Android: Handling images size for multiple screens

自作多情 提交于 2019-11-30 05:40:44
问题 I find it really hard to handle images with Android, I think it's the hardest part of Android development... 1) I have an image, I want it to be the background of my application so I do <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" tools:context=".MainActivity" android:background="@drawable/accueil"> <

Compress images to reduce file size

风格不统一 提交于 2019-11-29 18:38:29
问题 I'm building an app that lets the user take a photo or select one from the library on the iPhone and upload it to the Parse backend. The problem I'm facing is regarding to the size of the file. I've read about what big players like Facebook, Twitter, Instagram, and Google do regarding resolution and file size but I can't get close to that. I'm sure they have the best code and tools to do that but I'll be happy to implement it as good as possible with iOS regular processes. This is what I'm

Scale image according a maximum file size

半城伤御伤魂 提交于 2019-11-29 16:44:07
I'm using Imagick and like to scale an image to a maximum file size of 2.5MB I had a look to this SOF question: ImageMagick: scale JPEG image with a maximum file-size which is exactly what I want to do but the extent() method from Imagick does not have the size parameter: http://www.php.net/manual/en/imagick.extentimage.php Anyone knows how I could to it? At the moment I'm trying to calculate a coefficient between the original file size and the target file size to calculate a new resolution but found out that the resolution is not proportional to the file size. Update - The output format is

Android Camera Image Size

…衆ロ難τιáo~ 提交于 2019-11-29 13:11:13
问题 In my app, I was able to run a code using the camera class to take pictures, but it gives me 2048 x 1536 pixels as the image size. When I use the default camera of my android device, it gives me 2048 x 1232 pixels as the image size. Now, the question is, how can I make my app to give me the same image size like the default camera (which is 2048 x 1232) when I take picture? I have these codes: CameraActivity.java public class CameraActivity extends Activity { private static final String TAG =

php how to get web image size in kb?

≡放荡痞女 提交于 2019-11-29 11:49:18
问题 php how to get web image size in kb? getimagesize only get the width and height. and filesize caused waring . $imgsize=filesize("http://static.adzerk.net/Advertisers/2564.jpg"); echo $imgsize; Warning: filesize() [function.filesize]: stat failed for http://static.adzerk.net/Advertisers/2564.jpg Is there any other way to get a web image size in kb? 回答1: Short of doing a complete HTTP request, there is no easy way: $img = get_headers("http://static.adzerk.net/Advertisers/2564.jpg", 1); print

OpenCV - imread(), imwrite() increases the size of png?

别等时光非礼了梦想. 提交于 2019-11-29 09:26:47
问题 I wanted to try out some simple operations on files and I started with opening and saving files (I use Python) image = cv2.imread("image.png") cv2.imwrite("image_processed.png", image) After this operation my original image from 33kB transforms into the same looking 144kB image. I have tried doing something like this : http://opencv.itseez.com/modules/highgui/doc/reading_and_writing_images_and_video.html?highlight=imwrite#imwrite params = list() params.append(cv.CV_IMWRITE_PNG_COMPRESSION)

How to change WooCommerce thumbnail crop position?

跟風遠走 提交于 2019-11-29 08:25:14
I'm trying to change WooCommerce thumbnail crop position. I found this code can help to change the size: add_action( 'init', 'yourtheme_woocommerce_image_dimensions', 1 ); /** * Define image sizes */ function yourtheme_woocommerce_image_dimensions() { $catalog = array( 'width' => '100', // px 'height' => '100', // px 'crop' => 0 ); // Image sizes update_option( 'shop_catalog_image_size', $catalog ); // Product category thumbs } I did some try like change crop 0 to array("center", "bottom") but it's not working: function yourtheme_woocommerce_image_dimensions() { $catalog = array( 'width' =>