Re: ZMSMediaPlayer - Galerie

Niels Dettenbach <[email protected]> Tue, 13 Aug 2013 11:06:44 +0200
Newsgroups gmane.comp.cms.zms.devel
Organization Syndicat IT&Internet
Message-ID <5356712.3FhPFLtCMd@gongo>
--nextPart1377514.phFjivVvr9
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"

Am Montag, 12. August 2013, 23:42:56 schrieben Sie:
> You're right. I should have put that a bit differently. I didn't mean auto
> crop but auto resize. I think there are ways to make the gallery look
> alright even when they have different formats. 
No,
at least the ZMSMediaPlayer gallery did not work well with images in different 
side to side formats (we tried this many times before), especially if you 
can't know all the possible target formats any of your users will put images 
in (what is usually the case with typical non technical users). This only (!) 
makes any sense if all of the images are i.e. from the same digicam and not 
manipulated before uploading or in the same side by side format (without any 
vertical ones...).

But you might try it byself with that gallery.

Another option is to use the "gallerific" product which simply uses auto 
resize,y but no "mass upload" out of the box as it makes no sense because the 
images should have a description or similiar text with it.

> The thing is, that we really need it to be as easy to handle as possible and
> i see two problems with the current gallery. It might be confusing to some
> customers that it doesn't work with the sitemap open and yeah the cropping
> of course.
> 
> Are there any good ajax galleries you know of?
hmm,
there are different and i'm still produced two for different web sites with 
special layout and gallery needs.

One way to "solve" that problem in many of our gallery solutions is to just 
"fix" one of the both sides (height OR width) for all preview-images, 
dynamically auto-resizing to that "height" or "width".


I use a Python script like this for it:


# Parameter List: img,new_width='',new_height='',qual=95,sffx=''

REQUEST	  =  context.REQUEST
RESPONSE  =  REQUEST.response
newsize={}


if img:
   img_width  = float(img.getWidth())
   img_height = float(img.getHeight())
   #img_width  = 120.0
   #img_height = 120.0


   if new_height and new_width:
      new_height_out = int(new_height)
      new_width_out  = int(new_width)

   elif new_height:
      new_height = float(new_height)
      if img_height > float(new_height):
         fac = new_height / img_height
         new_width  = img_width * fac

   elif new_width:
      new_width = float(new_width)
      if img_width > float(new_width):
         fac = new_width / img_width
         new_height = img_height * fac

   else:
       new_height = img_height
       new_width  = img_width

   newsize['width'] = new_width
   newsize['height'] = new_height

   if sffx:
      sffx = "_" + sffx
   else:
      sffx = '_resizedbyside'

   new_img = context.pilutil().resize(img=img,size=(new_height, 
new_width),qual=95,mode='thumbnail', sffx=sffx)
   return new_img

else:
   return

--- schnapp ---

depending from what you give (height or width) as parameter it will auto 
resize down to thet height or width.

May be this helps you.


Best regards,


Niels.

-- 
 ---
 Niels Dettenbach
 Syndicat IT & Internet
 http://www.syndicat.com
 PGP: https://syndicat.com/pub_key.asc
 ---
 




--nextPart1377514.phFjivVvr9
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part.
Content-Transfer-Encoding: 7Bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)

iQIcBAABCAAGBQJSCfckAAoJEM78prARigUnhfkP/3iFs4nU4s2HEGvhFJ1uatXC
bLgvebfuN4K/MoMNuTwvj1e3piy33s59ewJ7K4VW0ymDvuDhcoJhCeQm6qMdf7hy
Al3mKtuzmdgEkbp02mZ4vzvHv7YJEzBvVnfgUSESA68ODI2zfCLpEXaKjlx1LGiX
zv3qhy5AbwH6HJJpoXZE3QFsrh7+LAjyw1wACFakgPBQZpW0ipGuhZ8j22ovylEU
zmA6zJi72NXw19VLOIlLpHKFYZDJv4MBrNLzOTpwncaPW7iiSrB7U56983IfoStl
GbKjVBCXHmLQ53Ks9OucSs8ZynFXkJC2I1GR9dbXzuTk3hWnKGlNPPKl2/ZaytV4
HdOz8gMxAsKE+BkQ0Ywwg0oeja3IHy+fIvOQEqLH4UAEf0pnsgXi3CRZU+it7Fcu
uRG12oKiYhOpUE6ubZrZywFpQ/NnaVlDFcwSgrR0t3C0dm4xrKXGJEkSzISdfu+O
WNyLw+OHq6eqLq5FHZ4ycZBHIQX5UOsyGy+njc2r/V+8UbBuiU/RaGMfdC3JCQHI
qcC8IiZcfGHwbzXEmSPmLBzeijx4X9KQhC/5aFx6qrHKH8o5P02ocjb+ks/zhFU2
LvGLyqLsu0n7vjPO4K9gjeByW+er0IEwjXO/t6PIKoDTKJBNL5lh3FfejjpzwWdG
YNe77TYmXmu65J3ZeUBg
=3Obx
-----END PGP SIGNATURE-----

--nextPart1377514.phFjivVvr9--