Compare commits

..
Author SHA1 Message Date
Terranom674 78546dceb3 Disable automatic workflow triggers; manual runs only 2026-10-19 20:28:48 +02:00
3 changed files with 27 additions and 40 deletions

No files matched your search

+1 -2
View File
@@ -1,8 +1,7 @@
name: Syntax Check
on:
push:
pull_request:
workflow_dispatch:
jobs:
php-syntax:
+1 -1
View File
@@ -1,7 +1,7 @@
<?php
/*
Plugin Name: Bratonien Tools
Version: 0.9.7.4
Version: 0.9.7.3
Description: Erweiterbare Administrationswerkzeuge fuer die Bratonien-Piwigo-Installation.
Plugin URI: https://github.com/Terranom674/Piwigo_Bratonien_Tools
Author: Bratonien
+25 -37
View File
@@ -6,7 +6,7 @@ if (PHP_SAPI !== 'cli')
exit(1);
}
const BRATONIEN_WEBDAV_DERIVATIVE_BUILDER_VERSION = '0.9.7.4';
const BRATONIEN_WEBDAV_DERIVATIVE_BUILDER_VERSION = '0.9.6.1';
$options = getopt('', array('piwigo-root:', 'connection-id:'));
$piwigo_root = rtrim((string)($options['piwigo-root'] ?? ''), '/');
@@ -48,27 +48,12 @@ if (!function_exists('bratonien_tools_webdav_image_source_info') || !function_ex
try
{
$standard_gallery = ImageStdParams::get_by_type(IMG_THUMB);
if (!$standard_gallery || !isset($standard_gallery->sizing->ideal_size))
$variants = bratonien_tools_webdav_derivative_variants();
if (!$variants)
{
throw new RuntimeException('Piwigo-Galeriederivat ist nicht konfiguriert.');
throw new RuntimeException('Keine Piwigo-Derivate konfiguriert.');
}
// Only the gallery thumbnail is prebuilt. Keep the Piwigo target type/path,
// but never crop to the 1x1 placeholder geometry. The real Nextcloud
// preview dimensions determine the aspect ratio.
$gallery_params = clone $standard_gallery;
$gallery_params->sizing = new SizingParams(
array(
(int)$standard_gallery->sizing->ideal_size[0],
(int)$standard_gallery->sizing->ideal_size[1],
),
0,
null
);
$gallery_params->type = IMG_THUMB;
$gallery_params->use_watermark = false;
$images = 0;
$generated_or_ready = 0;
$identity = 0;
@@ -124,31 +109,34 @@ try
}
$src = new SrcImage($row);
try
foreach ($variants as $variant_name => $params)
{
$probe = new DerivativeImage($gallery_params, $src);
if ($probe->same_as_source())
try
{
$identity++;
continue;
}
$probe = new DerivativeImage($params, $src);
if ($probe->same_as_source())
{
$identity++;
continue;
}
$detail = '';
if (bratonien_tools_webdav_generate_derivative($gallery_params, $src, $detail))
{
$generated_or_ready++;
$detail = '';
if (bratonien_tools_webdav_generate_derivative($params, $src, $detail))
{
$generated_or_ready++;
}
else
{
$errors++;
$error_lines[] = 'Bild #'.$image_id.' '.$variant_name.': '.($detail !== '' ? $detail : 'Derivat konnte nicht erzeugt werden.');
}
}
else
catch (Throwable $e)
{
$errors++;
$error_lines[] = 'Bild #'.$image_id.' Galerie: '.($detail !== '' ? $detail : 'Galeriederivat konnte nicht erzeugt werden.');
$error_lines[] = 'Bild #'.$image_id.' '.$variant_name.': '.get_class($e).': '.$e->getMessage();
}
}
catch (Throwable $e)
{
$errors++;
$error_lines[] = 'Bild #'.$image_id.' Galerie: '.get_class($e).': '.$e->getMessage();
}
}
if ($metadata_repaired > 0)
@@ -171,7 +159,7 @@ try
echo 'WebDAV-Derivative-Builder: version='.BRATONIEN_WEBDAV_DERIVATIVE_BUILDER_VERSION.
' bilder='.$images.
' varianten=1'.
' varianten='.count($variants).
' bereit='.$generated_or_ready.
' identisch='.$identity.
' metadaten_repariert='.$metadata_repaired.