1
I am sending my server via php script an image with original size 1000px wide by 350px high but the same is being resized to 800px wide by 280px high and I would like it to remain at the original size.
I use the Wideimage class and my code looks like this:
$arquivo_destino = $dir_destino . "/" . $nome_arquivo;
copy($arquivo_origem, $arquivo_destino);
// Vamos usar a biblioteca WideImage para o redimensionamento das imagens
require("../lib/WideImage/WideImage.php");
// INSERE A MARCA D'ÁGUA NA FOTO
// $image = WideImage::load($arquivo_destino);
// $marca = WideImage::load("../imagens/logo-marcadagua.png");
//$image->merge($marca, 'right', 'bottom')->saveToFile($arquivo_destino);
// Carrega a imagem enviada
$original = WideImage::load($arquivo_destino);
// Redimensiona a imagem original para tamanho miniatura
$arquivo_destino = $dir_destino . "/thumb/" . $nome_thumb;
$original->resize(175, 125, 'inside', 'down')->saveToFile($arquivo_destino);
// Redimensiona e salva
For Thumbs resizing the script works perfectly.
I’m not sure I understand the question but.. Couldn’t you just save 2 files? one original and the other to Thumbs?
– Leonardo Bosquett
sorry, I hadn’t noticed.. could edit and display the source of $archiv_source in the code?
– Leonardo Bosquett
The source: $file_source = $_FILES['file']['tmp_name']; $dir_destination = ".. /banner"; $cleanupTargetDir = true; // Remove old files $maxFileAge = 5 * 3600; // Temp file age in Seconds
– adventistapr
Your code looks ok, try this:
var_dump(getimagesize($arquivo_destino)); die;
after copying the file.– Leonardo Bosquett
Thank you @Leonardo Bosquett, was with size limitation in sending in the hosting.
– adventistapr