⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

need help for resize the uploaded image



ceroberoz
  • profile picture
  • Member

Posted 16 February 2014 - 19:00 PM

can anyone find the <img> element for display the uploaded image in the grocery crud?

I want to resize the uploaded image into smaller view (50-55% will do)

 

since my css is "mixed up", I only find the global CSS element in my metro-bootstrap library and I wish to added some class into GC's <img> element.

img_chitoge.png

 

thanks for your help.


Amit Shah
  • profile picture
  • Member

Posted 17 February 2014 - 13:43 PM

Hi there --

there are 2 ways.... to do it.. give a callback and generate your own code for the image (that might just be nasty)...

else - extract the feature from this library....

https://github.com/blakdronzer/POWER-GCrud

 

u may ignore all other stuff.. but take up the following

application/libraries/grocery_CRUD.php

application/libraries/img.php

application/config/img.php

application/config/grocery_crud.php

 

and make a provision for the thumbnails being cached in assets/grocery_crud/thumbcache

 

basically this GC library is modified to provide a cached thumbnails generated for bigger images like this and render automatiaclly @time of listing / edit / read - thumbnail for the same and on click - it will enlarge - as expected.

 

Happy GCing..:)


ceroberoz
  • profile picture
  • Member

Posted 24 February 2014 - 21:34 PM

I found the solution! :D

Guess the Coffee did the magic.

 

For the starter, I only want to resize the image displayed in the GC collumns because the whatever-I-build is image based so the real size preview is a no.

 

So here you go, just add the max-width values in the flexigrid a img CSS class :D

.flexigrid a img
{
    border: none;
    max-width: 50%;
}

I'd rather use %, not px for the responsive sake. But it's up to you if you want to use px instead %.

 

cheers. ^_^

 


Amit Shah
  • profile picture
  • Member

Posted 25 February 2014 - 12:45 PM

well.. it is a good solution but not for live.. because what it will still do is load the whole bit of big image and then resize the view into that 50pix with ... hence it is bandwidth conservative too for the same

 

Still if u wish to go ahead and use the same - its your choice...

 

Happy GCing:)