Jeg bruger WPForo til mit forum. Jeg bruger også wpForo Advanced Attachments: https://gvectors.com/product/wpforo-advanced-attachments/
Problemet er, at de uploadede billeder ændres i størrelse ... og er slørede
Jeg vil have dem vist i den størrelse, de blev uploadet i (behold den oprindelige størrelse).
Hvordan kan jeg gøre det?
Gå til: [YOU RSITE]/wp-content/plugins/wpforo-advanced-attachments/includes/class.wpForoAttachUploadHandler.php
og ændre: class.wpForoAttachUploadHandler.php med følgende kode:
1. Modificer imagemagick_create_scaled_image:
protected function imagemagick_create_scaled_image( $file_name, $version, $options ) {
list($file_path, $new_file_path) = $this->get_scaled_image_file_paths($file_name, $version);
// Instead of resizing, just copy the file
if ($file_path !== $new_file_path) {
return copy($file_path, $new_file_path);
}
return true;
}
2. Modificer imagick_create_scaled_image:
protected function imagick_create_scaled_image( $file_name, $version, $options ) {
list($file_path, $new_file_path) = $this->get_scaled_image_file_paths($file_name, $version);
// Skip resizing logic, just copy the original image
if ($file_path !== $new_file_path) {
return copy($file_path, $new_file_path);
}
return true;
}
3. Modificer handle_image_file (om nødvendigt) Hvis der er billedbehandling i denne function, skal du sørge for, at den også er bypasset:
protected function handle_image_file($file_path, $file) {
// Skip any resizing or processing
return;
}
Disse ændringer sikrer, at billedet bevarer sin oprindelige højde og bredde under uploadprocessen ved at deaktivere størrelsesændringstrinnene i din billedbehandling functions.
