198 questions
-1
votes
1
answer
79
views
How to get image width and height on a group of image in PHP
I have to get the width and height of hundreds of images.
I got this php to work on one image:
<?php list($width, $height) = getimagesize($_SERVER['DOCUMENT_ROOT'] ."/path/file.jpg"); ?&...
1
vote
2
answers
103
views
in php how can i check how close to a square an image is?
here is what i have so far. i am not sure if it's accurate, and even if it is, is there a better way to do this? i want to check images and determine if it's tall, wide, square, or kind of square. ...
0
votes
0
answers
75
views
How supress "jpegtopnm: WRITING PPM FILE" etc within output of jpegtopnm[Solved]
I want to see the sizes of images within a directory. For this purpose I do
$ for file in *.jpg; do jpegtopnm $file | pnmfile; done
Then I can see
jpegtopnm: WRITING PPM FILE
stdin: PPM raw, 960 by ...
-1
votes
1
answer
207
views
How do you display an image at the maximum available space?
I check if the image is vertical or horizontal. If it is horizontal, I rotate it:
@IBOutlet private weak var img: UIImageView!
img.image = file.image
let imageSize = file.image?.size
let imgWidth ...
0
votes
0
answers
29
views
The display of some images through the readfile does not work
I have this simple function that I use to display images on a website (due to mixed content) but it doesn't work for this particular one. How to view it?
Code:
<?php
$remoteImage = "http://...
0
votes
0
answers
428
views
PHP Warning: getimagesize getaddrinfo failed
I am trying to run the below code in w3schools try it php, but I get this error.
what did I miss?
$file="https://www.w3schools.com/html/pic_trulli.jpg";
function resize_image($file, $w, $h, $...
0
votes
1
answer
911
views
PHP - how to get mime type from getimagesize instead of a number
I am using PHP's getimagesize() function to get the height/width/type from an image URL. Currently, for a jpg file, $type is returning 2. How can I get it to return the actual mime type instead?
<?...
1
vote
0
answers
205
views
How can I take image size in kb, and Mb from the user to compress an image in android studio
I want to get the image size in kb and MB from the user.
Like, I have one image, and the image size is 1Mb so I want to compress this image size according to the size given by the user.
I used this ...
1
vote
0
answers
264
views
nginx getimagesize from local server: 403
I have a 403 error when trying to use the PHP function getimagesize on nginx based web server:
list($imageWidth, $imageHeight) = getimagesize($imagesSource['Main']);
Where $imageSource['Main'] is ...
0
votes
1
answer
301
views
Android - get image height by Picasso
I am having trouble showing images correctly in my application.
I wish the picture would retain its original proportions. I display
picture in the AppBar,
I am using Picasso to download images, but ...
1
vote
1
answer
129
views
php getimagesize with persian file name
I'm trying to write an Joomla plugin to add width and height tag to each <img> in HTML file.
Some image file names are Persian, and getimagesize faces error.
The code is this:
@$dom->...
2
votes
0
answers
177
views
php getimagesize mixes up width and height for IOS GIFs (Live Photos)
i am using php getimagesize to set width and height columns in the database. works fine with with every image except some GIFs shot by an Iphone camera(Live Photos). in that case the width and height ...
0
votes
1
answer
101
views
getimagesize () command problem! Loop promlem in command getimagesize ()
getimagesize () command in the For loop and the Foreach loop gives the same erroneous result. I just couldn't fix it. What is the reason for this, how can I fix it?
I take the picture files from the ...
0
votes
1
answer
2k
views
getimagesize / fopen connection refused
I am trying to get the size from an remote image with the native php function getimagesize from an absolute URL.
I am using PHP 7.3, here is the code:
$fichier = 'http://mydomain/images/image.jpg';
$...
0
votes
1
answer
224
views
Getimagesize is not working in host server - Hostinger
Code:
$urli = 'https://st.quantrimang.com/photos/image/2020/02/20/Zalo-bat-tim-quanh-day-1.jpg';
$size = getimagesize($urli);
echo $urli.'.</br>Size:';
echo $size[0].'</br>';
If run in ...