How to stop getcockpit from compressing photo uploads?

I didn’t think getcockpit compresses photo uploads by default, but when testing and comparing an upload to an original photo I can definitely see the pixelation. How can i stop getCockpit from compressing photos on upload?

Thank you!

Woops. I believe I was mistaken. My code had the thumbnail value where it should’ve had the full resolution photo. It now looks correct. However, the cockpit file size is slightly less than my original so I’m still not 100% sure if it’s still doing some compression.

I suppose it’s good to confirm in this thread if cockpit is compressing photo uploads in any way by default?

1 Like

It seems not. The file stream is directly written as is into a file - no adjustments, nothing.

# cp/modules/Cockpit/module/assets.php:103

// move file
$stream = fopen($file, 'r+');
$this->app->filestorage->writeStream("assets://{$path}", $stream, $opts); // $opts  = ['mimetype' => $fileMimetypeString];

Thumbnails are then later created via the thumbnail-util

http://cp/cockpit/utils/thumb_url
  ?src=http://cp/storage/uploads/2021/07/06/some-image-name.jpg
  &w=20
  &h=20
  &m=bestFit
  &re=1