Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/private/preview/txt.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) {

$lines = preg_split("/\r\n|\n|\r/", $content);

$fontSize = 5; //5px
$fontSize = ($maxX) ? (int) ((5 / 36) * $maxX) : 5; //5px
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oparoz

Txt seems to be the only exception, so maybe it best to fix the public page than mess with the preview system?
Maybe use 3 instead of 5 for now so that small previews work and large previews are a bit less bad?
$fontSize = ($maxX) ? (int) ((3 / 36) * $maxX) : 5; //5px

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oparoz I used 5 / 36 because this is the original font size that was used.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

$lineSize = ceil($fontSize * 1.25);

$image = imagecreate($maxX, $maxY);
Expand Down