Symfony sfAssetsLibraryPlugin assets resize script

Hi there!

I’d like to share with this pretty simple script with you, hope it will save you few minutes.

You guys who familiar with this Symfony plugin for assets management probably know that it uses sfThumbnail plugin for making thumbnails of image assets.
sfThumbnail has configuration in app.yml and it looks like:

all:
  sfAssetsLibrary:
    upload_dir:       media                  # Asset library root, under the web/ dir
    check_type:       false                  # Set to true if you want to restrict the type of assets
    types:            ['image']  # Accepted asset types if check_type is true
    thumbnail_dir:    thumbnail              # Where the image thumbnails are stored
    use_ImageMagick:  false                  # Set to true if you have the convert command
    thumbnails:                              # Name and size (in pixels) of the thumbnails created at upload
      tiny:                                 # Displayed in the list page
        width: 70
        height: 70
      small:                                 # Displayed in the list page
        width: 100
        height: 100
        shave: false                          # Cut strips to constraint the image size
      middle:
        width: 200
        height: 200
      large:                                 # Displayed in the details page
        width: 450
        height: 450
      original:                                 # Displayed in the details page
        width: 800
        height: 800
    search_pager_size: 20                    # Number of resuts per page
    mass_upload_size:  5                     # Number of file upload controls displayed in the mass upload form

This is cool but when you have your project up and running and decided to add new type of thumbnail (for instance name it ‘big’)

      big:
        width: 400
        height: 400
you’ll have a problem: you need to resize all old images according to new thumbnail type.

Read the rest of this entry »

From Symfony to Grails!

Few weeks ago I started learning Grails framework.

For me this is new world but it smells like Symfony sometimes – almost the same approaches with domain (Symfony: model) management, CRUD generator (Symfony: Admin generator) here excites as much as in Symfony.

“Leaving” PHP world for Groovy-Grails-Java was quite hard on start and I still stuck in researches. But I have smart enough guru in the stretched hand distance, please let me introduce Alex, The Grails Guru.

If you are Symfony developer you’d love this framework. You’ll see there similar things you’ve used to use in Symfony:

  • mvc: domain classes + controller classes + view in GSP pages
  • routing: you can define any route rule in a special routing construction
  • configuration: there no any YAML configuration files but .properties files instead
  • partials: are also present in Grails like includes
  • and so on, I can’t remember on a spot. I’ll be adding this list with new features.

BUT started developing Grails applications you’ll get all Java development advantages:

  • Continuous integration development
  • Maven 2, dependencies management (management of so many libraries becomes easiest task)
  • Reliable, usefulĀ  and fast IDE IntelliJ IDEA (you can try it for 30 days)
  • Professional TDD (saying the truth, not all PHP developers using it, but in Java world things become better)

On other hand you can try work with Grails on Ubuntu Linux, it is faster then Windows machines.

I’ll be posting my achievements and research results here while learning this amazing tool.

OpenGEO – yet another startup with Symfony

Name is: OpenGeo

Last Saturday 07/26/08 me and my friend decided to create simple online service for Ukrainian market.

Idea was in the follwoing – create free of charge open source database of geographical locations of all IP addresses of Ukraine.
Every visitor has possibility to see his IP address and set his Ukrainial location with help of drop downs.

Possible stakeholders of this service are:

- e-commerce services like auctions, online malls
it would be easy to find goods near to you with it, for example find motorbike in 50km radius.

- social services (social networks)
Also find people near to your location and get in contact

- and so on, connected to location definition

So we decided to start development of this project with Symfony (actually I enforced him to do that :) ).

Two days ago we finished first stage and now project in “locations-collection” stage.

Please take a look on www.opengeo.org.ua

The next step will be development of analysis module and user interface improvements, for example make location tag-cloud instead of select-boxes.

Feel free to say your opinion in comments to this post – it will be very useful!

Get Adobe Flash playerPlugin by wpburn.com wordpress themes