News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

undefined function exif_read_data() inSubs-Graphics.php on line 369

Started by Antechinus, August 07, 2021, 06:16:14 PM

Previous topic - Next topic

Antechinus

NOTE: This may actually belong in Site Comments, Issues and Concerns.
Turns out it's an issue with the RC4 downloads hosted on this site. :)



Here's some fun and games. I just go around to updating a local test site to RC4.
Subs-Graphics.php was overwritten by the large upgrade pack anyway. It's a fresh copy, straight from the zip on the downloads section of this site.
Complete error essage is:
( ! ) Fatal error: Uncaught Error: Call to undefined function exif_read_data() in B:\VertrigoServ\www\SMF_21x\Sources\Subs-Graphics.php on line 369
( ! ) Error: Call to undefined function exif_read_data() in B:\VertrigoServ\www\SMF_21x\Sources\Subs-Graphics.php on line 369


Line 369 is this:
if (($exif_data = @exif_read_data($destination)) !== false)
Anyone have some popcorn? :D



ETA: Just took a look at the .gz version of the download. That's an odd one too. It has a .tar, insiade a .tar, inside the .gz. IOW, an extra layer of .tar over the usual. Same code on lIne 369 of Subs-Graphics.php too.

ETA2: Aha! I just took a look in the Github repo, and the offending block of code is no longer in Subs-Graphics.php in the repo.

Code from downloads on this site:
elseif ($fp_destination)
{
$mime_valid = check_mime_type($source, implode('|', array_map('image_type_to_mime_type', array_keys($default_formats))), true);
if (empty($mime_valid))
return false;

$sizes = @getimagesize($source);

$fp_source = fopen($source, 'rb');
if ($fp_source !== false)
{
while (!feof($fp_source))
fwrite($fp_destination, fread($fp_source, 8192));
fclose($fp_source);
}
else
$sizes = array(-1, -1, -1);
fclose($fp_destination);
}

$rotate = 0;
if (($exif_data = @exif_read_data($destination)) !== false)
{
if (!empty($exif_data['Orientation']))
{
switch($exif_data['Orientation'])
{
case 8:
$rotate = 90;
break;
case 3:
$rotate = 180;
break;
case 6:
$rotate = -90;
break;
}
}
}

// We can't get to the file. or a previous getimagesize failed.
if (empty($sizes))
$sizes = array(-1, -1, -1);


Code from current GitHub repo:
elseif ($fp_destination)
{
$mime_valid = check_mime_type($source, implode('|', array_map('image_type_to_mime_type', array_keys($default_formats))), true);
if (empty($mime_valid))
return false;

$sizes = @getimagesize($source);

$fp_source = fopen($source, 'rb');
if ($fp_source !== false)
{
while (!feof($fp_source))
fwrite($fp_destination, fread($fp_source, 8192));
fclose($fp_source);
}
else
$sizes = array(-1, -1, -1);
fclose($fp_destination);
}

// We can't get to the file. or a previous getimagesize failed.
if (empty($sizes))
$sizes = array(-1, -1, -1);


ETA3: Replacing the file from this site's downloads with the file from the current GitHub repo fixes the issue. :)

Antechinus

Is anyone looking into this? You do realise you are hosting screwed RC4 upgrade packs on this site?

Illori

even if we are, technically we dont fix them until we do another release as it causes a lot of confusion.

we recommend most to download 2.1 from github anyway.

Antechinus

There is no "even if" about it. You are. Definitely.

Recommendations are all very well, but those upgrade packs are stil available for download here, and if anyone is on this site and looking for RC4 it is logical that some of them will try the official downloads. Which, as mentioned, will immediately kill any site they are uploaded to.

This has no effect on me. I could not particularly give a damn. I know exactly what causes the issue and how to fix it. However, I think it would be of concern to the Project Manager. It is not going to make this project look good if you can't even get your official upgrade packs right, and can't be bothered fixing them.


vbgamer45

You are missing exif support in your php install.

On windows you have to edit the php.ini and include the php_exif extension
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

lurkalot

Quote from: Antechinus on August 07, 2021, 06:16:14 PM

I just go around to updating a local test site to RC4.


I had the same error back in June 25th when testing on my local setup which is running Laragon.  Turned out the exif module was turned off .  Turned it back on and all was good.

Douglas

I gotta agree with Ant here (shock of all shocks). Fixing the existing packages will head off potential additional workload issues for the support teamies.

Logically, it makes sense to fix the current downloads on this site if the issue is a pretty sizable one. I do think this one qualifies.

Not everyone has the ability to manipulate their php.ini settings, so it makes sense to get the issue addressed within your own zip file to address this, ASAP.
Doug Hazard
* Full Stack (Web) Developer for The Catholic Diocese of Richmond
(20+ Diocesan sites, 130+ Church sites & 24 School sites)
* Sports Photographer and Media Personality
* CFB Historian
* Tech Admin for one 1M+ post, one 2M+ post and one 10M+ post sites (last two are powered by multiple servers)
* WordPress Developer (Junkie / Guru / Maven / whatever)

Steve

Quote from: Illori on August 08, 2021, 07:37:17 PM
even if we are, technically we dont fix them until we do another release as it causes a lot of confusion.

we recommend most to download 2.1 from github anyway.

For a lot of us (myself included) it's github that is confusing.

I have to agree with Antechinus and Douglas, the download site should have the latest and correct versions.
DO NOT pm me for support!

Illori

We can't update the download site daily for every fix. I do believe there is a link to a daily install and upgrade package that the users can use. We can't make sure an rc release will not have any bugs.

Kindred

Thing is, Steve,  the RC4 RELEASE is a snapshot.
Anything fixed after that snapshotis not RC4.... and you've seen the semicomplicated process we have to go through to actually MAKE a release.
Additionally,  we can't upload a "new" version of rc4 to our site. That would break all sorts of stuff, and just cinfuse users.  We'd have to make an RC5 release.

Incidentally,  I do not see this error, because my php already has existed compiled in...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Steve

DO NOT pm me for support!

Sesquipedalian

Quote from: Kindred on August 09, 2021, 12:43:54 PM
Additionally,  we can't upload a "new" version of rc4 to our site. That would break all sorts of stuff, and just cinfuse users.  We'd have to make an RC5 release.

This is correct, and we currently have no plan to release an RC5. As can be seen in the SMF 2.1 milestones, our next target is SMF 2.1.0. Obviously, I make no promises about the future, but that's the current situation.

If people can't wait for 2.1.0, they are encouraged to grab the latest from GitHub.

Quote from: Steve on August 09, 2021, 12:02:50 PM
For a lot of us (myself included) it's github that is confusing.

Please see the attached image for instructions on how to get the latest from GitHub. :)

Alternatively, see Download for nightly(github) smf2.1 to get prebuilt nightly packages.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Steve

DO NOT pm me for support!

LiroyvH

Thanks Ant for reporting this and the effort of checking out what's going on/what's wrong. :)
((U + C + I)x(10 − S)) / 20xAx1 / (1 − sin(F / 10))
President/CEO of Simple Machines - Server Manager
Please do not PM for support - anything else is usually OK.

Advertisement: