Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1] 2   Go Down

Author Topic: Please help : Warning: getimagesize(): Read error!  (Read 16519 times)

0 Members and 1 Guest are viewing this topic.

drakaina

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 12
    • Drakaina Fantasy art Muse
Please help : Warning: getimagesize(): Read error!
« on: April 21, 2004, 02:54:22 pm »

Hello,
I've been trying to upload images in my albums but everytime I get this message telling me the images could not be uploaded because it was impossible to resize or create thumbnail (translated from french below) :
"Les images 'albums/userpics/10001/4.jpg' ne peuvent pas être insérées dans l'album

Impossible de créer l'vignette ou l'image réduite.



Warning: getimagesize(): Read error! in /home/drakaina/www/galeries/include/picmgmt.inc.php on line 193     "

Could someone please help me figure it out? I really like CPG 1.2 and would love to have it work properly  :wink:
However it has worked with for 2 images but won't work again  :cry:
Thanks for all the help you could give me
Drakaina
Logged

hyperion

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 1317
  • - retired -
Please help : Warning: getimagesize(): Read error!
« Reply #1 on: April 21, 2004, 11:28:33 pm »

getimagesize is a built in PHP function that collects information about image files.  The error is telling you that it does not understand the image file. This could have many reasons:

1. The relevant PHP files could be corrupted or out of date.  

2. The image may be of a type not handled by the function.


You should try:

1. Saving the image in other formats and in other imaging software. Then try uploading again.

2. Updating to the latest stable version of PHP.
Logged
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(http://www.mozilla.org/products/firefox/buttons/getfirefox_small.png)

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Please help : Warning: getimagesize(): Read error!
« Reply #2 on: April 22, 2004, 06:42:20 am »

getimagesize has been reported to consume large resources, that's why some webhosts decided to disable the function. Happened with my webhost as well, and they didn't bother to notify their customers. Took me a while to figure. If you're webhosted and getimagesize used to work for you once, contact your webhost and ask them for support.

GauGau
Logged

drakaina

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 12
    • Drakaina Fantasy art Muse
Re: Please help : Warning: getimagesize(): Read error!
« Reply #3 on: April 22, 2004, 03:08:23 pm »


You should try:

1. Saving the image in other formats and in other imaging software. Then try uploading again.

2. Updating to the latest stable version of PHP.
Hello and thanks for your advices  :)
My pictures are all in a jpeg format and were created in photoshop 7.
About the lates version of PHP, all I have is coppermine , phpmyadmin2.2.6 and and MySQL.. which one should I change (as you can see I am fairly new to all of this lol ::)     )

Yes GauGau I am actually webhosted but I was able to upload an image and then (the same day, about 2 mns later) all I kept getting was this error message... I am really puzzled here  ???
Thank you both for taking the time to help me  :-*
Drakaina
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Please help : Warning: getimagesize(): Read error!
« Reply #4 on: April 22, 2004, 03:15:19 pm »

create a small script on your page to test getimagesize and run it in your browser, like this
Code: [Select]
<?php
list($width$height$type$attr) = getimagesize("img/flag.jpg");
echo 
"<img src=\"img/flag.jpg\" $attr alt=\"getimagesize() example\" />";
?>
(you'll have to modify the img/flag.jpg-bit accordingly to point to a pic that actually exists on your page.

GauGau
Logged

drakaina

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 12
    • Drakaina Fantasy art Muse
Re: Please help : Warning: getimagesize(): Read error!
« Reply #5 on: April 22, 2004, 03:24:14 pm »

Call me "stupid" but on which page I am I supposed to put the script you are telling me about?? I am really sorry to bug you with this but I am so completly lost :(...
Drakaina
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Please help : Warning: getimagesize(): Read error!
« Reply #6 on: April 22, 2004, 03:42:14 pm »

create a new file on your hard drive, name it test.php, open it with a text editor, paste the code mentioned above into it (edit the image path accordingly), save it, upload it to your webroot and run it in your browser http://yoursite.tld/test.php
If you don't understand one word, you'd better contact your webhost and ask them for support...

GauGau
Logged

drakaina

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 12
    • Drakaina Fantasy art Muse
Re: Please help : Warning: getimagesize(): Read error!
« Reply #7 on: April 22, 2004, 07:09:05 pm »

hello again  :D
I did that and all I get is a red cross  :( Here is the link to the test http://drakaina.com/test.php
I did check the image path, no problem there . >:(
What could I do next?
Many thanks in advance
Drakaina
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Please help : Warning: getimagesize(): Read error!
« Reply #8 on: April 24, 2004, 12:25:24 pm »

it's not recommended to post a link to your phpinfo, might be a security risk. I recommend removing the phpinfo file from your webserver.
Apparently you can use coppermine; it should be able to run without getimagesize as well, you'll just have to edit a little code...

GauGau
Logged

drakaina

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 12
    • Drakaina Fantasy art Muse
Re: Please help : Warning: getimagesize(): Read error!
« Reply #9 on: April 24, 2004, 01:59:27 pm »

Thank you GauGau I will remove it asap :)
I am glad to know I can use coppermine :)
Quote
it should be able to run without getimagesize as well, you'll just have to edit a little code...
ok but how do I do that? I mean i can edit a file and change the code as long as i know what i am supposed to do lol ;)
Thanks
Drakaina
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Please help : Warning: getimagesize(): Read error!
« Reply #10 on: April 24, 2004, 02:08:45 pm »

Will require massive code changes. It's best to create a custom function called getimagesize if you don't have the one from php.
Hard to tell you what to do exactly, since getimagesize is being used in 10 files.

GauGau
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Please help : Warning: getimagesize(): Read error!
« Reply #11 on: April 24, 2004, 02:45:41 pm »

on second thought, I think I didn't read your original posting properly: after all getimagesize is there, but returns an error! This is what the manual says about that error:
Quote
If accessing the filename image is impossible, or if it isn't a valid picture, getimagesize() will return FALSE and generate a warning.

So, there are two things to check: did you chmod correctly? Is the pic a valid image? If you're not sure, post a deep link to the page in question.

GauGau
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Please help : Warning: getimagesize(): Read error!
« Reply #12 on: April 24, 2004, 03:02:35 pm »

for those who actually don't have getimagesize (that doesn't mean you, drakaina) : you could use something like this in include/functions.inc.php:
Code: [Select]
<?php

if (function_exists(getimagesize)==false)
{
  function 
getimagesize($contents) {
    return 
getimagesize_url($contents);
    }
}

function 
getimagesize_url($image_url) {
   
$handle fopen ($image_url"rb");
   
$contents "";
   if (
$handle) {
   do {
       
$count += 1;
       
$data fread($handle8192);
       if (
strlen($data) == 0) {
           break;
       }
   
$contents .= $data;
   } while(
true);
   } else { return 
false; }
   
fclose ($handle);

   
$im ImageCreateFromString($contents);
   if (!
$im) { return false; }
   
$gis[0] = ImageSX($im);
   
$gis[1] = ImageSY($im);
// array member 3 is used below to keep with current getimagesize standards
   
$gis[3] = "width={$gis[0]} height={$gis[1]}";
   
ImageDestroy($im);
   return 
$gis;
}


?>
GauGau
Logged

drakaina

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 12
    • Drakaina Fantasy art Muse
Re: Please help : Warning: getimagesize(): Read error!
« Reply #13 on: April 24, 2004, 03:33:30 pm »

on second thought, I think I didn't read your original posting properly: after all getimagesize is there, but returns an error! This is what the manual says about that error:
Quote
If accessing the filename image is impossible, or if it isn't a valid picture, getimagesize() will return FALSE and generate a warning.

So, there are two things to check: did you chmod correctly? Is the pic a valid image? If you're not sure, post a deep link to the page in question.

GauGau
Well I chmoded in 777 sinceI thought that was why i could not upload the pics. My images are all in jpeg so I do not see why they would be invalid (could they?) Beside these pics are the same already uploaded on my website so I know they do work.
Thanks
Drakaina
Ps : could it be that I do  not have enought web space (on my webhost) left or something likethat?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Please help : Warning: getimagesize(): Read error!
« Reply #14 on: April 24, 2004, 03:55:27 pm »

If 777 doesn't work for you try 755 (depends on server config).
There a differences in jpegs as well - there have been reports that only jpegs in RBG work, CMYK ones won't.

GauGau
Logged

drakaina

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 12
    • Drakaina Fantasy art Muse
Re: Please help : Warning: getimagesize(): Read error!
« Reply #15 on: April 24, 2004, 04:01:27 pm »

Ok I changed it back to 755 and I checked for the files, they are RGB jpegs (from photoshop 7)
I am currently looking at the file picmgmt.inc.php  since it says my error comes from line 193 on this page. Is this where I shoul change the code?
Drakaina
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Please help : Warning: getimagesize(): Read error!
« Reply #16 on: April 24, 2004, 04:11:00 pm »

Please try with another jpeg image, like the one attached to this posting, as the line in picmgmt.php is actually there to verfiy wether a pic is valid or not.

GauGau

[attachment deleted by admin]
Logged

drakaina

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 12
    • Drakaina Fantasy art Muse
Re: Please help : Warning: getimagesize(): Read error!
« Reply #17 on: April 24, 2004, 04:24:44 pm »

i get an error telling me I am not allowed to  download nor upload a picture/file on this board :(
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Please help : Warning: getimagesize(): Read error!
« Reply #18 on: April 24, 2004, 05:43:32 pm »

Then just right click, and 'save picture as'
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

drakaina

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 12
    • Drakaina Fantasy art Muse
Re: Please help : Warning: getimagesize(): Read error!
« Reply #19 on: April 24, 2004, 05:56:34 pm »

I just did but here is what i got :
The picture 'albums/userpics/10001/beispiel.jpg' can't be inserted in the album

Unable to create thumbnail or reduced size image.



Warning: getimagesize(): Read error! in /home/drakaina/www/galeries/include/picmgmt.inc.php on line 193

Drakaina :(
Logged
Pages: [1] 2   Go Up
 

Page created in 0.029 seconds with 19 queries.