Announcement

#1 2021-03-11 13:01:51

Jyskip
Member
2021-02-03
41

Unable to upload .tif / .tiff files?

Hello/Hi/Greetings,

It seems like i need to configure something for uploading .tif files?
When uploading thru the web it just "freeze" with the uploading progress bar.
https://i.imgur.com/v49tFPr.png

I have added the following code in the localEditor

$conf['file_ext'] = array_merge(
  $conf['picture_ext'],
  array('tiff','tif','jpg','jpeg','png','gif')
  );
$conf['upload_form_all_types'] = false;
$conf['picture_ext'] = array('tiff','tif','jpg','jpeg','png','gif');

But don't seems to work?

Piwigo 2.10.2 Check for upgrade
Operating system: Linux
PHP: 7.3.19-1~deb10u1 (Show info) [2021-03-11 13:01:09]
MySQL: 5.5.5-10.3.25-MariaDB-0+deb10u1 [2021-03-11 13:01:09]
Graphics Library: External ImageMagick 6.9.10-23

Piwigo URL: http://guldmann.billedarkiv.com/

Offline

 

#2 2021-03-11 15:47:14

erAck
Only trying to help
2015-09-06
2026

Re: Unable to upload .tif / .tiff files?

What did give you the idea to fiddle with the extensions that way?
The default is

Code:

// picture_ext : file extensions for picture file, must be a subset of
// file_ext
$conf['picture_ext'] = array('jpg','jpeg','png','gif');

// file_ext : file extensions (case sensitive) authorized
$conf['file_ext'] = array_merge(
  $conf['picture_ext'],
  array('tiff', 'tif', 'mpg','zip','avi','mp3','ogg','pdf')
  );

Note that the order of the statements is significant because $conf['file_ext'] merges content of $conf['picture_ext'], resulting in

$conf['file_ext'] = array('jpg','jpeg','png','gif','tiff', 'tif', 'mpg','zip','avi','mp3','ogg','pdf');

If you later in your local config have

$conf['file_ext'] = array_merge(
  $conf['picture_ext'],
  array('tiff','tif','jpg','jpeg','png','gif')
  );

that will expand to (identical string keys are replaced during merge, i.e. deduplicated)

$conf['file_ext'] = array('jpg','jpeg','png','gif','tiff','tif');

after which you set

$conf['picture_ext'] = array('tiff','tif','jpg','jpeg','png','gif');

The $conf['upload_form_all_types'] value now doesn't matter at all because both sets contain the same extensions though in different order (which may or may not be relevant to your problem, I don't know).

It may be that TIFF files can't be treated as picture image files in all contexts and that would be the reason that .tif and .tiff are not in the original picture_ext set. So rather than doing awkward things with the arrays, leave them alone and instead to allow files of file_ext simply set

Code:

$conf['upload_form_all_types'] = true;

If for some reason you do not want to allow movies and other files like zip and pdf then set also

Code:

$conf['file_ext'] = array_merge(
  $conf['picture_ext'],
  array('tiff', 'tif')
  );

Running Piwigo at https://erack.net/gallery/

Offline

 

#3 2021-03-12 08:36:30

Jyskip
Member
2021-02-03
41

Re: Unable to upload .tif / .tiff files?

Hello,

I have changed the code back to the original state - and allowed all files types
But it still hangs.. :-(

https://i.imgur.com/0M9CJaD.png

Offline

 

#4 2021-03-12 13:25:30

Jyskip
Member
2021-02-03
41

Re: Unable to upload .tif / .tiff files?

Hmm..

Thought about - file sizes..
I have changed the "upload_max_filesize" in /etc/php/7.3/apache2/php.ini
I have a phpinfo.php page, where the limit was 2M i have upscaled this to 100M
And changed post_max_size to 400M - thinking it was a size limitation, due to smaller .png files uploads without any issues..

When uploading .tif file it "freeze" and spits out the following error in the F12 console

admin.php?page=photos_add&section=direct:510 Uncaught TypeError: Cannot read property 'id' of null
    at o.Uploader.UploadComplete (admin.php?page=photos_add&section=direct:510)
    at o.Uploader.<anonymous> (1m5025s.js:108)
    at Array.<anonymous> (1m5025s.js:93)
    at i (1m5025s.js:93)
    at Object.r [as inSeries] (1m5025s.js:93)
    at o.Uploader.dispatchEvent (1m5025s.js:93)
    at o.Uploader.trigger (1m5025s.js:93)
    at o.Uploader.g (1m5025s.js:108)
    at 1m5025s.js:108

Im following information provided from this post: [Github] Piwigo issue #920

There is also mentioned that

$conf['upload_dir'] = './upload';

could have something to do about it, but all .tif files are placed in here.. - so i will think that the directory is working?

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact