Skip to content

Conversation

@szaimen
Copy link
Contributor

@szaimen szaimen commented Nov 10, 2021

Fix #26118

Signed-off-by: szaimen [email protected]

Copy link
Member

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

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

👍

@PVince81
Copy link
Member

Failed asserting that 1636558324 is equal to 1636558325 or is greater than 1636558325.

😮

@PVince81 PVince81 merged commit 1efdd6c into master Nov 19, 2021
@PVince81 PVince81 deleted the fix/26118/imagecreatetruecolor-error branch November 19, 2021 16:24
@szaimen
Copy link
Contributor Author

szaimen commented Nov 19, 2021

/backport to stable23

@szaimen
Copy link
Contributor Author

szaimen commented Nov 19, 2021

/backport to stable22

@szaimen
Copy link
Contributor Author

szaimen commented Nov 19, 2021

/backport to stable21

@backportbot-nextcloud
Copy link

The backport to stable23 failed. Please do this backport manually.

@backportbot-nextcloud
Copy link

The backport to stable22 failed. Please do this backport manually.

@backportbot-nextcloud
Copy link

The backport to stable21 failed. Please do this backport manually.

@szaimen
Copy link
Contributor Author

szaimen commented Nov 19, 2021

/backport to stable23

@szaimen
Copy link
Contributor Author

szaimen commented Nov 19, 2021

/backport to stable22

@szaimen
Copy link
Contributor Author

szaimen commented Nov 19, 2021

/backport to stable21

@Littlericket
Copy link

Littlericket commented Jan 18, 2022

@szaimen this doenst catches (i dont know why would somebody has these file sizes but ..)

ValueError: imagecreatetruecolor(): Argument #2 ($height) must be greater than 0 in /var/www/html/lib/private/legacy/OC_Image.php:780
Stack trace:
#0 /var/www/html/lib/private/legacy/OC_Image.php(780): imagecreatetruecolor(107, 4294967144)
#1 /var/www/html/lib/private/legacy/OC_Image.php(616): OC_Image->imagecreatefrombmp('/var/www/html/d...')
#2 /var/www/html/lib/private/Preview/Image.php(52): OC_Image->loadFromFile('/var/www/html/d...')

@stratege1401
Copy link

Hello, seem the issue is back on NC23.0.3 and app Previewgenerator 4.0

2022-03-26T19:27:08+00:00 Scanning folder /Benjamin/files/Photo famille/2012-09-23 r An unhandled exception has been thrown: ValueError: imagecreatetruecolor(): Argument #2 ($height) must be greater than 0 in /var/www/html/lib/private/legacy/OC_Image.php:898 Stack trace: #0 /var/www/html/lib/private/legacy/OC_Image.php(898): imagecreatetruecolor() #1 /var/www/html/lib/private/legacy/OC_Image.php(717): OC_Image->imagecreatefrombmp() #2 /var/www/html/lib/private/Preview/Image.php(52): OC_Image->loadFromFile() #3 /var/www/html/lib/private/Preview/GeneratorHelper.php(62): OC\Preview\Image->getThumbnail() #4 /var/www/html/lib/private/Preview/Generator.php(245): OC\Preview\GeneratorHelper->getThumbnail() #5 /var/www/html/lib/private/Preview/Generator.php(140): OC\Preview\Generator->getMaxPreview() #6 /var/www/html/lib/private/PreviewManager.php(227): OC\Preview\Generator->generatePreviews() #7 /var/www/html/apps/previewgenerator/lib/Command/Generate.php(243): OC\PreviewManager->generatePreviews() #8 /var/www/html/apps/previewgenerator/lib/Command/Generate.php(214): OCA\PreviewGenerator\Command\Generate->parseFile() #9 /var/www/html/apps/previewgenerator/lib/Command/Generate.php(212): OCA\PreviewGenerator\Command\Generate->parseFolder() #10 /var/www/html/apps/previewgenerator/lib/Command/Generate.php(212): OCA\PreviewGenerator\Command\Generate->parseFolder() #11 /var/www/html/apps/previewgenerator/lib/Command/Generate.php(192): OCA\PreviewGenerator\Command\Generate->parseFolder() #12 /var/www/html/apps/previewgenerator/lib/Command/Generate.php(138): OCA\PreviewGenerator\Command\Generate->generateUserPreviews() #13 /var/www/html/lib/private/User/Manager.php(656): OCA\PreviewGenerator\Command\Generate->OCA\PreviewGenerator\Command\{closure}() #14 /var/www/html/apps/previewgenerator/lib/Command/Generate.php(139): OC\User\Manager->callForSeenUsers() #15 /var/www/html/3rdparty/symfony/console/Command/Command.php(255): OCA\PreviewGenerator\Command\Generate->execute() #16 /var/www/html/3rdparty/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run() #17 /var/www/html/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand() #18 /var/www/html/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun() #19 /var/www/html/lib/private/Console/Application.php(211): Symfony\Component\Console\Application->run() #20 /var/www/html/console.php(99): OC\Console\Application->run() #21 /var/www/html/occ(11): require_once('...')

Tried "dirty trick" from nextcloud/previewgenerator#252
`replace $process = imagecreatetruecolor($width, $height); with this block :

if ($width > 0 and $height > 0){ $process = imagecreatetruecolor($width, $height); } else { $process = false; }`

But it did not work for me ( error on my side maybe)

Thanks...

@Adi-18
Copy link

Adi-18 commented Apr 12, 2022

Same here. "dirty trick" from nextcloud/previewgenerator#252 don't works because of cascading failure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ValueError: imagecreatetruecolor(): Argument #1 ($width) must be greater than 0

7 participants