Forums  ›  Cheetah  ›  Bug Reports
 

Photos Won't Crop

Ok, i believe i have solved this problem. It's has to do with 3'rd party js files that can cause interference with the croppers image load event.

I will be pushing updates to the repo as soon as i finish all my local testing.

I reverted to the original code because I'd made changes to the thumb sizes. Same result so I think the original code was okay. It was a recent download from Github.

Here's the result when trying to use logon as member....

 

I've sent a PM

I may need the site URL and a test user account to play with, and FTP access to the files so i can debug the code to try and figure out whats going on.

 

No plans to keep original - ever!

Bad offerings however. It works fine for me as Admin.

If I log on as another member or switch to another member, it doesn't work So I can crop and rotate my own pics, but nobody else can. Cleared caches, checked code. going insane.

 

Great. Now i have to figure out why something that should have been working is not.

Oh, BTW. If you decide you want to switch to and keep the original, you will need to undo that code change, but i am assuming you are not going to ever keep originals.

 

 

That worked!

Thanks Deano.  Greatly appreciated.

 

PhotosModule.php 116-118

$sSrcFileName = $this->_oConfig->getFilesPath() . $aInfo['medID'] . str_replace('{ext}', $aInfo['medExt'], $this->_oConfig->aFilesConfig['file']['postfix']);

        // use image type file if original is not found.

        if(!$sSrcFileName) $sSrcFileName = $this->_oConfig->getFilesPath() . $aInfo['medID'] . str_replace('{ext}', $aInfo['medExt'], $this->_oConfig->aFilesConfig['file']['postfix']);

 

PhotosPageView.php linea 260- 266

 

$sImageUrl = $this->oSearch->getImgUrl($this->aFileInfo['Hash'], 'file');

        $aImageSize = getimagesize($sImageUrl);

        if(!$aImageSize) {

            // use image type file if original is not found.

            $sImageUrl = $this->oSearch->getImgUrl($this->aFileInfo['Hash'], 'file');

            $aImageSize = getimagesize($sImageUrl);

        }

 

 

Ok, as i have marked in green above, try replacing the word original with file, save and see what happens. The code as it was is correct and should be working and i cannot explain why it is not on your site.

PhotosModule.php 116-118

$sSrcFileName = $this->_oConfig->getFilesPath() . $aInfo['medID'] . str_replace('{ext}', $aInfo['medExt'], $this->_oConfig->aFilesConfig['original']['postfix']);

        // use image type file if original is not found.

        if(!$sSrcFileName) $sSrcFileName = $this->_oConfig->getFilesPath() . $aInfo['medID'] . str_replace('{ext}', $aInfo['medExt'], $this->_oConfig->aFilesConfig['file']['postfix']);

 

PhotosPageView.php linea 260- 266

 

$sImageUrl = $this->oSearch->getImgUrl($this->aFileInfo['Hash'], 'original');

        $aImageSize = getimagesize($sImageUrl);

        if(!$aImageSize) {

            // use image type file if original is not found.

            $sImageUrl = $this->oSearch->getImgUrl($this->aFileInfo['Hash'], 'file');

            $aImageSize = getimagesize($sImageUrl);

        }

 

 

Ok. The code is correct, so i don't understand why yours is doing that.

Open modules\cheetah\photos\classes\ChPhotosModule.php and paste here lines 116-118

Open modules\cheetah\photos\classes\ChPhotosPageView.php and paste here lines 260-266

It's enough. The old one is using the smaller file image, but the other is trying to pull the original which you have set to delete, it should not be doing that if it cannot be found.

I'll see if i can trace it, but i don't get it. It should be using file.

 

Re Orientation. Don't spend too much time on it yet because it's just two members.

Re cropping: I uploaded the latest repo from Github and the same problem exists. Maybe this will help:

This is the Inspector reading the working Cropper on version 1.2.0. There was an image displayed at the time.

This is the same section on 1.3.0. The window is blank.

I can send you a bigger chunk if it helps.

As for orientation. I will have to look into that.

However, cheetah is using the same html5 uploader that dolphin is using, so orientation should not be a issue if the html5 uploader is being used. I am pretty sure i removed the older uploader from cheetah.

So i'll have to run some testing and see if i can figure out whats going on.

Sometime beta testing is not enough. The software has to be used.

Anyhow, your going to have to try replacing some of the files with current ones from the repo.

Get a current copy of the repo and replace the files for /modules/cheetah/photos with the ones from the repo.

Things are going from bad to worse here. I only have 10 new members on the 1.3.0 site, but a large percentage of uploaded photos are sideways and even up-side-down. There seem to be two offenders, but I thought Boonex introduced code into the photo uploader to rectify this many years ago. On another boonex site with thousands of photos, this has never been an issue. It's on the same server.

You made a post on the subject way back in 2014 but I was of the opinion the uploader was fixed in later releases:

https://www.boonex.com/forums/topic/Check-orientation-of-uploaded-image-and-rotate-.htm

I have GD Library running, but the photos in question seem to have a mind of their own.

 

I've been running 1.3.0 for months, but I've only allowed people to use it in the past few days. It goes to show that BETA testing should remain just that until the stable version is released, but the script has been virtually bullet proof until a couple of people started uploading photos.

The easiest solution for me is to get the cropping module working so that they can rotate their own photos, but I can't find out what stopping it from firing.

 

I replaced the code. It didn't make any difference.

The crop does work with Medium photos in 1.20, but not in 1.3.0

I searched the photos module and couldn't see many changes. The main one is:

1.2.0 ChPhotosModule.php working 144

        $sUri = dechex($iId . str_replace('.', '0', microtime(true)));

1.3.0 ChPhotosModule.php not working 144

        for ($x = 0; $x <= 10; $x++) {

            $sUri = substr(md5(microtime(true) . $x), 0, 16);

            if (uriCheckUniq($sUri, 'ch_photos_main', 'Uri')) {

                continue;

            }

        }

Maybe the problem goes deeper?

 

 

I had another try just in case. It seems like the script is recognising the M (medium) photos, but they don't appear in the window.

I thought it was okay as well. I don't have 1.2.0 on my computer so I can check. If you can locate the issue, can you tell me what files I need to update? Ta.

 

I'll look into it. I thought i recently fixed that one. It may not be in the repo yet.

I'm calling this a bug, but a similar problem was originally in Dolphin.

If you set the Photos module to delete the original photo after uploading, the crop feature doesn't work. 

It works fine when the original is there, but when it's not saved, the crop module shows a blank screen. 

I've just introduced my site to a small beta group and one member is already posting sideways photos. The crop feature will be fantastic to allow them to rectify the problem easily.

If I recall, Boonex did fix the problem when I brought it to their attention, but their crop feature was VERY basic compared the one in Cheetah.

Forums  ›  Cheetah  ›  Bug Reports