|
|
@@ -188,7 +188,10 @@ class Studiou_WC_FPP_Admin {
|
|
|
|
|
|
$added = 0;
|
|
|
foreach ($records as $record) {
|
|
|
- $file_path = get_attached_file($record->attachment_id);
|
|
|
+ $file_path = wp_get_original_image_path($record->attachment_id);
|
|
|
+ if (!$file_path) {
|
|
|
+ $file_path = get_attached_file($record->attachment_id);
|
|
|
+ }
|
|
|
if ($file_path && file_exists($file_path)) {
|
|
|
// Use order number prefix if available
|
|
|
$prefix = $record->order_id ? 'order-' . $record->order_id . '_' : '';
|
|
|
@@ -283,8 +286,11 @@ class Studiou_WC_FPP_Admin {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // Serve the file
|
|
|
- $file_path = get_attached_file($attachment_id);
|
|
|
+ // Serve the original (unscaled) file — WP auto-scales images above the big-image threshold.
|
|
|
+ $file_path = wp_get_original_image_path($attachment_id);
|
|
|
+ if (!$file_path) {
|
|
|
+ $file_path = get_attached_file($attachment_id);
|
|
|
+ }
|
|
|
if (!$file_path || !file_exists($file_path)) {
|
|
|
wp_die(__('File not found.', 'studiou-wc-free-photo-product'));
|
|
|
}
|