Feature Request: Suggestions to improve the CssSpriteGen
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
CSS Sprite Generator |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
Hi!
I'm using the CssSpriteGen class in my projects for automatic sprite generation of assets. With assets i mean images uploaded through my CMS.
However, in order to get this to work i have been hacking quite alot in the CssSpriteGen class.
These are the suggestions i have though to improve the CssSpriteGen class and make it more usable in other applications.
* Reduce the cyclic complexity. I've counted it to 27 in the CssSpriteGen class.
* Separate the main CssSpriteGen from the rest of the application, eg. $this->aFormValues. The ideal scenario would be to have two different applications, one for the web upload and one for the Sprite generation itself.
* Provide a method called something like, AddImageToSprit
* Split out code from the large methods in the CssSpriteGen class. The CreateSprite Method is 435 lines long.
* Either code an Option class or provide methods for setting sprite options.
* Have proper PhpDoc blocks for all methods and provide an Api Reference.
* Create classes for unit tests. Unit tests are neccissary in order to auto generate sprites in a production environment, but this one is on the wishlist.
Best Regards
Patrik
Changed in css-sprite-generator: | |
status: | New → Triaged |
importance: | Undecided → Wishlist |
Hi Patrick,
All good points. Most of these are already on our list of things to look
at - we have a number of ideas for re-using the class ourselves which
requires many of these changes. If you've made any changes as a result of
your integration that you'd like to feed back please let me know and I'll
update the main code base accordingly.
Regards,
Ed
> Public bug reported: e($filename) , so generator /bugs.launchpad .net/bugs/ 474332
>
> Hi!
>
> I'm using the CssSpriteGen class in my projects for automatic sprite
> generation of assets. With assets i mean images uploaded through my CMS.
> However, in order to get this to work i have been hacking quite alot in
> the CssSpriteGen class.
>
> These are the suggestions i have though to improve the CssSpriteGen
> class and make it more usable in other applications.
>
> * Reduce the cyclic complexity. I've counted it to 27 in the CssSpriteGen
> class.
> * Separate the main CssSpriteGen from the rest of the application, eg.
> $this->aFormValues. The ideal scenario would be to have two different
> applications, one for the web upload and one for the Sprite generation
> itself.
> * Provide a method called something like, AddImageToSprit
> it can be used from CMSs. Then generate sprites from that private
> accessible list of files. In that way the CssSpriteGen class can be used
> by many different applications.
> * Split out code from the large methods in the CssSpriteGen class. The
> CreateSprite Method is 435 lines long.
> * Either code an Option class or provide methods for setting sprite
> options.
> * Have proper PhpDoc blocks for all methods and provide an Api Reference.
> * Create classes for unit tests. Unit tests are neccissary in order to
> auto generate sprites in a production environment, but this one is on the
> wishlist.
>
> Best Regards
>
> Patrik
>
> ** Affects: css-sprite-
> Importance: Undecided
> Status: New
>
> --
> Feature Request: Suggestions to improve the CssSpriteGen
> https:/
> You received this bug notification because you are a member of Project
> Fondue, which is subscribed to CSS Sprite Generator.
>