• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.

[Fixed] Can't resize BMP images / No se puede redimensionar imagen BMP

Xampy5

Chevereto Noob
//English...
Hello! Thank you Rodolfo for keep this great upload tool for free (at least until now :p). It's the best image upload tool that I've ever seen with jquery.

Well, here's my problem: when I want to upload an image of type BMP, it uploads correctly. But if I want upload it chaging it's size (with the "resize image" tool from the web) then it uploads the image with type BMP but with errors, the image can not show correctly.

I know where's the error, I've tried to solve it, but I didn't win nothing.

The error is in engine.php, just below this:
// LINE 510 if ($tipo==jpg) {
// LINE 511 $src = imagecreatefromjpeg($target);
// LINE 512 }
there must be:
Code:
if ($tipo==bmp) {
                    $src = imagecreatefromBMP($target);
                }
But that function doesn't exist, I found one in the php.net forum but it doesn't work fine with this.

Thanks.


//
//Español...
Hola!Gracias Rodolfo por mantener esta gran herramienta de subida de imagenes de forma gratuita (por lo menos hasta ahora :p). Es la mejor herramienta para subir imagenes (via web) que jamás haya visto con la libreria jquery implementada.

Bien, aqui esta mi problema: cuando quiero subir una imagen de tipo BMP, se sube correctamente. Pero si la quiero subir cambiandole el tamaño (con el "resize image" de la web) entonces se sube la imagen en el formato BMP pero con errores, no se puede ver la imagen.

Se donde esta el error, he intentado solucionarlo, pero no he conseguido nada.

El error esta en engine.php, debajo de:
// LINEA 510 if ($tipo==jpg) {
// LINEA 511 $src = imagecreatefromjpeg($target);
// LINEA 512 }
deberia de haber un:
Code:
if ($tipo==bmp) {
                    $src = imagecreatefromBMP($target);
                }
Pero esa funcion no existe, encontre una en el foro de php.net pero no funciona bien con esto.

Gracias!
 
I never noticed that bug... Mostly like because bmp is a bad format for web because it has no compression and is not widely used.

The script is supposed to resize and then host this kind of images, but I'm think that will be better to convert this BMP into PNG files (like imageshack). So, i have to write some function that converts BMP to GD2 and then to PNG. I will mark this as a TODO for the next revision.


--

Nunca note este problema... Probablemente por que bmp es un formato malo para web en el sentido de que no tiene compresión y es muy poco usado.

Se supone que el script debería redimensionar y hospedar este tipo de archivos pero creo que seria mejor que automáticamente convierta estas imágenes a otro formato, por ejemplo PNG (como lo hace imageshack). Para ello tendría que usar alguna función que me permita pasar de BMP a GD2, luego crear PNG a partir de GD2. Lo voy a dejar anotado como futura mejora.
 
Oh, yo intente hacer lo que tu dices. Pase de BMP a GD2 y de GD2 a JPG, pero no funciono xD (se ve que habia un error, me salia la pantalla en blanko (blank/empty) y no supe solucionarlo, ya que no me mostraba donde estaba el error).

Gracias por responder :)
 
Lo arregle! puedes verlo funcionando en el demo... Como no ando de ánimos de lanzar una revisión en este momento, te dejo el código de engine.php en pastie.org
Link: http://pastie.org/1123534

Ahh y ya tiene tu fix del problema de tamaño invalido que posteaste hace poco.
 
Woaaaaaaah! It wasn't working, but just because of a tiny bug:

Xampy said:
if ($mimosa=="image/bmp" || $mimosa=="image/x-ms-bmp") { ////// Line 397

Just add the red part and it will work sooooooooo pretty fine!

Thank you for the function Rodolfo :)!!!
 
Xampy5 said:
Woaaaaaaah! It wasn't working, but just because of a tiny bug:

Xampy said:
if ($mimosa=="image/bmp" || $mimosa=="image/x-ms-bmp") { ////// Line 397

Just add the red part and it will work sooooooooo pretty fine!

Thank you for the function Rodolfo :)!!!

...Of course MS bmp.
Fixed.
 
Back
Top