Search…

X3 Photo Gallery Support Forums

Search…
 
override
Topic Author
Posts: 8
Joined: 24 May 2021, 16:25

Need info before purchase

25 May 2021, 07:29

Hi everybody, I'm trying to solve a problem before purchasing this fantastic photo/file manager.
My website runs on Windows Server. Despite of this php scripts work smoothly except this page. Infact I'm not able to see the pictures. All file are shown correctly but no preview of images.
I've read that there could be a problem with php-gd so the image_mime_type is my problem.
Plese, could anyone help me to bypass this issue? I don't need to have all the info about the single image. Such as size, file extention, date created and so on. I just need to display the pictures contained in each folder with it's name. That's all.
Once I've fixed this problem I can purchase a license and put the site online.
Let me take the chance to congratulate with the authors. One single page is able to do all this. Belive me when I say I've tried so many but you left me spechless and astonished when I've found your work.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Need info before purchase

26 May 2021, 02:06

override wrote:All file are shown correctly but no preview of images.
I need a bit more info ... Or even better, do you have a link? It's not clear to me if the preview images display as image icons or empty (image load error). I assume the latter ... It sounds a lot like you are missing the PHP GD extension, but I can't be 100% sure. The best way to find the exact error, is to try to load one of the resized images directly in browser: Open Chrome > View > Developer > Developer Tools, click "network" tab, click "img" tab, and reload page. The images (with errors) will come up there (likely in red color), and then you can right-click and "open in new tab", where you would see a more descriptive error.

It could also be other things, for example insufficient memory assigned for resizing.
override wrote:I've read that there could be a problem with php-gd so the image_mime_type is my problem.
Yes likely PHP GD, disabled or not installed. I assume this is your own server? It would not be a problem with mime type.

Another option to detect your servers PHP info, create a file "info.php", edit it and write <?php phpinfo(); ?>. Then in browser /info.php and it will display all your PHP server info. Amongst other things, you would find information about "GD" and memory_limit.
 
override
Topic Author
Posts: 8
Joined: 24 May 2021, 16:25

Re: Need info before purchase

26 May 2021, 22:17

Thankyou first of all for your quick reply.
I've followed your instructions and found out that:
1) php-gd are correctly installed on the ISP server. I don't own the server myself and I've atteched a screenshot of info.php as you instructed me;
2) from console log, yes images are highlited in red;
3) whatever I set image_mime_type to true or false I still see empty icons where it's supposed to see the images contained in folder;
4) when I click to open the image, a black background with "Image coud not be loaded" appears and if I follow the link in it a new tab pops up and says "Error Empty mime type".
After checking php infos I'm sure that server, even if it runs Windows Server and my hosting plan is not mixed, has php-gd support and everything is enabled, so the problem must be somewhere else.
As I've protected the pae with password if you want I can reset it and let you go to the page so that you can check yourself.
Attachments
filesapp3.png
filesapp3.png (23.69 KiB) Viewed 8795 times
filesapp2.png
filesapp2.png (24.24 KiB) Viewed 8795 times
filesapp1.png
filesapp1.png (85.04 KiB) Viewed 8795 times
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Need info before purchase

27 May 2021, 00:12

I see in your 2nd screenshot "image not loaded", and that's loading the original image, so nothing to do with resizer or GD. So basically, I need to know why that image is not loading. You need to right-click the link "The image could not be loaded" and open in new tab ... What's the error message? Incorrect path? Maybe you can't use @ characters in your server URL paths ...

Yes if you can share a public link with me (private message) I would be happy to take a look.
 
override
Topic Author
Posts: 8
Joined: 24 May 2021, 16:25

Re: Need info before purchase

27 May 2021, 01:11

When I right click on the link you wrote I se what is the attached picture. But let me reset the password and I fowrward you the link so you can check yourself
Attachments
filesapp4.png
filesapp4.png (2.64 KiB) Viewed 8792 times
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Need info before purchase

27 May 2021, 02:15

Ok, it looks like your server is missing both of the two functions mime_content_type() and finfo_file() that can be used to determine a file's type / mime_type. To check this, create a file "test.php" with the following:
Code
<?php
var_dump('mime_content_type' . (function_exists('mime_content_type') ? 'yes' : 'no') . '<br>');
var_dump('finfo_file' . (function_exists('finfo_file') ? 'yes' : 'no') . '<br>');
Then load /test.php in browser and check output. I suspect you will get "no" for both function existence checks.

It is possible to get things to work without checking MIME, but it's not reliable. For example, we should check that a file "image.jpg" is actually an image before we attempt to resize it (theoretically, it could be bad.php renamed to image.jpg). Also, when outputting images with PHP, we need to forward the mime type to browser.
 
override
Topic Author
Posts: 8
Joined: 24 May 2021, 16:25

Re: Need info before purchase

27 May 2021, 02:29

Yes you're right I've got NO for both mime_content_type and finfo_file.
I would try the othe way you wrote even if not realible and I explain why.
I have to use this page on the admin side only. And the reason is just to check that user do not upload forbidden pictures, such as porno. That's why I'd be happy also with just the image preview but if there's the possibility to enlarge it it would be more than welcome.
Now what should I do to make the changes you suggested?
I really don't have big needs about all the other features, even if I appreciate them.

P.S. You wrote "For example, we should check that a file "image.jpg" is actually an image before we attempt to resize it (theoretically, it could be bad.php renamed to image.jpg)."
I'm sure that there will only be .jpg, .jpeg, .tiff and .gif on the server because the system I've created allows only theese extentions to be uploaded from users.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Need info before purchase

27 May 2021, 03:39

I should first recommend that you enable one of the functions to check mime types. It is after all standard PHP functions. Is this a hosting service? If so, they often have PHP options available in the control panel which allow you to toggle certain functions and extensions. If this is your own server, it should be as easy as to edit the php.ini file and then "restart" server.

If you want to proceed with the "hack", I think it would be quite simple, although it will "assume" that all images are JPEG. If they are not, it should still work, although "mime-type" in response headers might be wrong if the image is PNG or GIF. Open your Files index.php and locate around line 406:
Code
// get mime
function get_mime($path){
  if(function_exists('mime_content_type')){
    return mime_content_type($path);
  } else {
    return function_exists('finfo_file') ? finfo_file(finfo_open(FILEINFO_MIME_TYPE), $path) : false;
  }
}
Change to:
Code
// get mime
function get_mime($path){
  return 'image/jpeg';
  if(function_exists('mime_content_type')){
    return mime_content_type($path);
  } else {
    return function_exists('finfo_file') ? finfo_file(finfo_open(FILEINFO_MIME_TYPE), $path) : false;
  }
}
Let me know if it works. PS! If you update Files app, you will need to re-apply this fix.
 
override
Topic Author
Posts: 8
Joined: 24 May 2021, 16:25

Re: Need info before purchase

27 May 2021, 04:44

YEAH...! It works great. Now I can see the images and all of them. Now jpg, jpeg, png, gif and tiff are all shown as well as thumb or as enlarged.

Thanks a lot for you help. I really appreciate your help and will procced with purchase immediately.

P.S. Would it be possible to change the look? I mean how can I change some details such as background color, font color etc. The style.css is unaccessible to me. If it's not possible it doesn't matter, I'm still happy.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Need info before purchase

27 May 2021, 04:51

override wrote:P.S. Would it be possible to change the look? I mean how can I change some details such as background color, font color etc. The style.css is unaccessible to me. If it's not possible it doesn't matter, I'm still happy.
It's definitely "possible", but you would need knowledge of CSS (and HTML). You cannot "edit" the default CSS Files app stylesheet as that is complex, minified and loaded from CDN. You can add your own stylesheet _files/css/custom.css which will be loaded into Files app, where you can override styles. You would need to know what classes to override though, and that would normally be done by inspecting elements from your browser developer tools Elements inspector.
 
override
Topic Author
Posts: 8
Joined: 24 May 2021, 16:25

Re: Need info before purchase

27 May 2021, 05:03

Ok, ok I'm fine with css. I've seen the classes used and will do it by myself. I've sent you a private message about the license. I made the purchase but there's a little difference in the email address of purchaser. Please have alook and let me know. Thanks again.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Need info before purchase

09 Nov 2021, 06:16

For your information, the issues you had with mime type checking have been resolved in Files app 0.3.0.