#121 Plugin "SensitiveContent" messes up proportion in attachments

Closed
opened 4 years ago by aab · 12 comments
aab commented 4 years ago

I had it activated since... i don't remember. Attachments in the two nodes i administer were showing with no proportion; through setconfig.php i managed to show them a bit better. Disabling the plugin brings everything back to normal.

I had it activated since... i don't remember. Attachments in the two nodes i administer were showing with no proportion; through setconfig.php i managed to show them *a bit* better. Disabling the plugin brings everything back to normal.
someonewithpc commented 4 years ago
Collaborator

Wait, all attachments were affected by this plugin?

Wait, all attachments were affected by this plugin?
aab commented 4 years ago
Poster

Yes, both nodes showed that behaviour on all attachments.

Yes, both nodes showed that behaviour on all attachments.
someonewithpc commented 4 years ago
Collaborator

@aab my latest commit should fix this issue, but I don't really have a way to test it

@aab my latest commit should fix this issue, but I don't really have a way to test it
aab commented 4 years ago
Poster

I've just tried on one of the nodes; as soon as the plugin is activated, proportion is gone.

I've just tried on one of the nodes; as soon as the plugin is activated, proportion is gone.
someonewithpc commented 4 years ago
Collaborator

What do you mean by proportion? I might be misunderstanding you

What do you mean by proportion? I might be misunderstanding you
aab commented 4 years ago
Poster

Ok, i'll try to explain better with images.

Now, the one without is specially distorted, as i I had to change width and height thumbnails with setconfig in order to "fix" it: most of thumbnails fit in 600x90, as they are links, and not images like this. (Edit)Ah, and it doesn't depend on the theme used.

Ok, i'll try to explain better with images. Now, the one without is specially distorted, as i I had to change width and height thumbnails with setconfig in order to "fix" it: most of thumbnails fit in 600x90, as they are links, and not images like this. (Edit)Ah, and it doesn't depend on the theme used.
Diogo Cordeiro commented 4 years ago
Owner
Fixed with https://notabug.org/diogo/gnu-social/commit/9b587ae4a3f9e2e6f9ec2f496f631d7aaf045417 as seen in https://social.hackersatporto.com/conversation/5622#notice-11624
aab commented 4 years ago
Poster

Ok, sorry to reopen this, just a couple of things:

  • In the new README, this is the example:

addPlugin('SensitiveContent', ['hideforvisitors' => true]

But it does not work unless i write

addPlugin('SensitiveContent', ['hideforvisitors' => true]);

  • Appart from that, i keep having distorted images with the plugin. I know it has been fixed, and i know why they keep being distorted: before i knew this plugin was responsible, i used setconfig.php to give thumbnails a fixed measure of 600x90. I've tried restoring them to the default value, 450x600:

https://khp.ignorelist.com/conversation/206812#notice-426573

Is there any way to set this to "auto" (or something like that), so the thumbnails get the proportion they need?

Ok, sorry to reopen this, just a couple of things: - In the new README, this is the example: <code> addPlugin('SensitiveContent', ['hideforvisitors' => true] </code> But it does not work unless i write <code> addPlugin('SensitiveContent', ['hideforvisitors' => true]); </code> - Appart from that, i keep having distorted images with the plugin. I know it has been fixed, and i know why they keep being distorted: before i knew this plugin was responsible, i used setconfig.php to give thumbnails a fixed measure of 600x90. I've tried restoring them to the default value, 450x600: https://khp.ignorelist.com/conversation/206812#notice-426573 Is there any way to set this to "auto" (or something like that), so the thumbnails get the proportion they need?
Diogo Cordeiro commented 4 years ago
Owner

Fixed the README.

run ./scripts/clean_thumbnails.php

Relevant settings concerning thumbs: https://notabug.org/diogo/gnu-social/src/nightly/lib/util/default.php#L285-L289

  • crop: Crop to the given dimensions (not preserving aspect ratio)
  • maxsize: width and height won't be larger than this value (just re-read the code and, I don't think this setting was needed at all, it would be more helpful if it was an actual max size for a thumb file or smth...)
  • width: Max width
  • height: Max height
  • upscale: Whether to allow a thumb to acquire greater dimensions than its original file or not
Fixed the README. run `./scripts/clean_thumbnails.php` Relevant settings concerning thumbs: https://notabug.org/diogo/gnu-social/src/nightly/lib/util/default.php#L285-L289 - `crop`: Crop to the given dimensions (not preserving aspect ratio) - `maxsize`: width and height won't be larger than this value (just re-read the code and, I don't think this setting was needed at all, it would be more helpful if it was an actual max size for a thumb file or smth...) - `width`: Max width - `height`: Max height - `upscale`: Whether to allow a thumb to acquire greater dimensions than its original file or not
aab commented 4 years ago
Poster

It seems i got it just like the default values:

thumbnail            dir                  '/var/www/html/file/thumb'
thumbnail            path                 NULL
thumbnail            server               NULL
thumbnail            crop                 'false'
thumbnail            maxsize              1000
thumbnail            width                '450'
thumbnail            height               '600'
thumbnail            upscale              'false'
thumbnail            animated             'false'

The only difference i can see is that "dir" is defined.

I've executed clean_thumbnails, but there has been no change.

Just in case, i've looked in db, everything seems fine...

MariaDB [gnusocial]> select * from config where section = 'thumbnail';
+-----------+----------+-------+
| section   | setting  | value |
+-----------+----------+-------+
| thumbnail | animated | false |
| thumbnail | crop     | false |
| thumbnail | height   | 600   |
| thumbnail | upscale  | false |
| thumbnail | width    | 450   |
+-----------+----------+-------+
It seems i got it just like the default values: ```` thumbnail dir '/var/www/html/file/thumb' thumbnail path NULL thumbnail server NULL thumbnail crop 'false' thumbnail maxsize 1000 thumbnail width '450' thumbnail height '600' thumbnail upscale 'false' thumbnail animated 'false' ```` The only difference i can see is that "dir" is defined. I've executed clean_thumbnails, but there has been no change. Just in case, i've looked in db, everything seems fine... ````sh MariaDB [gnusocial]> select * from config where section = 'thumbnail'; +-----------+----------+-------+ | section | setting | value | +-----------+----------+-------+ | thumbnail | animated | false | | thumbnail | crop | false | | thumbnail | height | 600 | | thumbnail | upscale | false | | thumbnail | width | 450 | +-----------+----------+-------+ ````
aab commented 4 years ago
Poster

I've checked the plugin today after all this time, i'm afraid there's still disproportion in images: https://gnusocial.net/conversation/4963984#notice-8172421

setconfig.php -a | grep thumbnail gives

thumbnail            dir                  '/var/www/gnusocial/file/thumb'
thumbnail            path                 NULL
thumbnail            server               NULL
thumbnail            crop                 'false'
thumbnail            maxsize              1000
thumbnail            width                450
thumbnail            height               '600'
thumbnail            upscale              'false'
thumbnail            animated             'false'
thumbnail            file_quota           '2097152'
thumbnail            process_links        'true'
thumbnail            show_thumbs          'true'
MariaDB [gnusocial]> select * from config where section = 'thumbnail';
+-----------+---------------+---------+
| section   | setting       | value   |
+-----------+---------------+---------+
| thumbnail | animated      | false   |
| thumbnail | crop          | false   |
| thumbnail | file_quota    | 2097152 |
| thumbnail | height        | 600     |
| thumbnail | process_links | true    |
| thumbnail | show_thumbs   | true    |
| thumbnail | upscale       | false   |
+-----------+---------------+---------+

I've also run clean_thumbnails. Anything else i'm missing?

I've checked the plugin today after all this time, i'm afraid there's still disproportion in images: https://gnusocial.net/conversation/4963984#notice-8172421 setconfig.php -a | grep thumbnail gives ```` thumbnail dir '/var/www/gnusocial/file/thumb' thumbnail path NULL thumbnail server NULL thumbnail crop 'false' thumbnail maxsize 1000 thumbnail width 450 thumbnail height '600' thumbnail upscale 'false' thumbnail animated 'false' thumbnail file_quota '2097152' thumbnail process_links 'true' thumbnail show_thumbs 'true' ```` ```` MariaDB [gnusocial]> select * from config where section = 'thumbnail'; +-----------+---------------+---------+ | section | setting | value | +-----------+---------------+---------+ | thumbnail | animated | false | | thumbnail | crop | false | | thumbnail | file_quota | 2097152 | | thumbnail | height | 600 | | thumbnail | process_links | true | | thumbnail | show_thumbs | true | | thumbnail | upscale | false | +-----------+---------------+---------+ ```` I've also run clean_thumbnails. Anything else i'm missing?
aab commented 3 years ago
Poster

Fixed with "php scripts/setconfig.php thumbnail crop 0"

Fixed with "php scripts/setconfig.php thumbnail crop 0"
Sign in to join this conversation.
No Milestone
No assignee
3 Participants
Loading...
Cancel
Save
There is no content yet.