More information, I can get image info of another WordPress web site like this:
$imgINFO = getimagesize(‘http://www.archertargets.com/images/logos/Facebook_icon_2.png’);
But I can’t get image information of any image of http://www.smartcommunity.es, another sample:
$imgINFO = getimagesize(‘http://smartcommunity.es/wp-content/uploads/2017/01/Logo-Smart-Community-Tra.png’);
It isn’t an uploads folder problem because I can’t get image information of a image out of uploads folder:
$imgINFO = getimagesize(‘http://smartcommunity.es/wp-content/themes/trades/img/Card-Blank.jpg’);
Thanks, Xavi
-
This reply was modified 9 years, 1 month ago by
Xavierator.
-
This reply was modified 9 years, 1 month ago by
Xavierator.
-
This reply was modified 9 years, 1 month ago by
Xavierator.
-
This reply was modified 9 years, 1 month ago by
Xavierator.
If the image you are interested in is attached to a post by using the attachment post_type (the normal situation), you can get all sorts of meta data, including pixel sizes of each defined size (thumbnail, medium, large, etc.), with wp_get_attachment_metadata().
You will need the attachment post’s ID, which can be found various ways. For example, getting all image attachments whose parent ID is that of the current post. Then check the corresponding filenames until the correct attachment post is found.
Dear bcworkz,
The images has been uploaded by profile WP plugin or ftp with dreamweaver.
To get the images information I only have their url.
Thanks, Xavi
-
This reply was modified 9 years, 1 month ago by
Xavierator.
I see, thanks for the extra info. AFAICT it appears to be a server configuration or security issue for smartcommunity.es. I also am unable to use getimagesize() on images on that server. I get:
Warning: getimagesize(http://smartcommunity.es/wp-content/uploads/2017/03/yyyy.png): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden
The images there open fine in a normal browser. In saving the image, then uploading to my server by FTP, getimagesize() works fine, so it is not anything related to the image itself or WP in general. It appears to be specific to the smartcommunity.es server where file access via PHP is forbidden there.
Ok, thanks for your information, I will contact with my client in order to resolve the server security, access, …
Thanks, Xavi