Commit Graph
43 Commits
Author SHA1 Message Date
Bharat Mediratta 33775f9fb0 Throw an exception in graphics::resize() if the input file is empty 2009-04-22 19:50:38 +00:00
Bharat Mediratta f243e8d41c Be graceful if exec() is disabled 2009-04-17 09:50:53 +00:00
Bharat Mediratta c936eebcf7 Don't do graphics detection in core_installer::install() because that
gets run at scaffolding::package() time, not on the target machine.
Instead, create a core module variable to trigger running
graphics::choose_default_toolkit() on the first admin login after install.

Fixes ticket #206.
2009-04-05 20:43:05 +00:00
Andy Staudacher ed7175092c Refactor all translation strings that have ambiguous placeholders.
E.g. "%link_startClick here%link_end" is now '<a href="%url">Click here</a>'.

Note: This isn't always the best solution. E.g. consider "Foo <a href='%url' class='gDialogLink'>bar</a>." Now the translator has to deal with 
preserving CSS classes too...
2009-03-21 07:44:46 +00:00
Bharat Mediratta 4fed34873a Don't let graphics::resize() upscale images.
Fixes ticket #117.
2009-03-09 06:59:05 +00:00
Tim Almdal c04ff8e02f Change the pattern to identify tables that need prefix substitution to
mirror the drupal pattern of using braces {}.
2009-02-28 06:37:28 +00:00
Tim Almdal bd15853708 This implements table prefix for all the queries in core, user, exif,
tag, search, comment and notification modules (Ticket #68)
2009-02-27 21:07:18 +00:00
Bharat Mediratta 515c081f79 Add support MP4 movies also. Flowplayer supports them and can stream
them using the h264streaming plugin.  Everything else is a fairly
minor change.
2009-02-25 05:27:29 +00:00
Tim Almdal b40f25cbed Remove debugging information 2009-02-23 22:37:49 +00:00
Tim Almdal c0049dce03 1) Optimize the loop in graphics::generate so it uses the $ops as the
key and path.  This way it won't try to generate a resize for movies.
2) Changed the options on the ffmpeg command in movie::extract_image
so we actually see a frame not the black one that starts the movie.
2009-02-23 17:13:58 +00:00
Bharat Mediratta 37d3254d8c Remove debug code, thanks Andrew Slayman! 2009-02-23 01:36:54 +00:00
Bharat Mediratta f924cd66ac Remove the $item from the various graphics functions, that was a bad
idea.  Instead convert movies to jpeg before doing any
transformations, which keeps the graphics functions clean and abstract
and dealing solely with image types.  Lighter/simpler solution.
2009-02-22 23:55:47 +00:00
Bharat Mediratta baff63b70b Very basic movie support. You can upload a FLV file, we use ffmpeg to
extract a thumbnail out of it and if you click through we show it
using flowplayer.
2009-02-22 05:21:44 +00:00
Bharat Mediratta d8049cf711 Album cover fixes. Don't bomb in generate if we can't load the album
cover (it might be deleted and we forgot to update the
album_cover_item_id column).  Also, exclude albums with missing
album_cover_item_id's from the dirty query.
2009-02-15 00:57:19 +00:00
Tim Almdal ac06fcd26c Remove the Database::query call for deletes and updated and use
Database::delete or Database::update instead
2009-02-12 21:44:55 +00:00
Bharat Mediratta 3a83c4e76f Properly implement changing the thumbnail and resized image sizes by
updating the graphics rules as appropriate.
2009-02-08 10:18:09 +00:00
Bharat Mediratta 442d9295c6 Change mark_all_dirty to mark_dirty and specify what we want to mark dirty. This will be useful for Admin_Theme_Details 2009-02-08 06:40:57 +00:00
Tim Almdal 54646583bc Remove the try/catch as it was being fixed twice 2009-02-07 21:05:04 +00:00
Tim Almdal 80d4df3a4a Convert all item->type == "album" to item->is_album()
Convert all item->type == "photo" to item->is_photo()
2009-02-06 03:47:36 +00:00
Tim Almdal 04fe9da190 Addressed the issues in ticket 34.
Surround the the attempt to use gd_info with a try catch block.
Created a new class gInstalledToolkit which has the highlighting and
the over pointer definition.  Now if you mouse across an inactive
toolkit it remains inert.
2009-02-05 23:29:44 +00:00
Bharat Mediratta 3e54159d5c Guard against the case where gd_info() isn't defined 2009-02-05 08:38:15 +00:00
Bharat Mediratta b2e37f20c7 Move graphics::rebuild_dirty_images to core_task::rebuild_dirty_images 2009-01-16 04:35:35 +00:00
Andy Staudacher e4a9b19bf9 Changing t() placeholder syntax from {{replace_me}} to %replace_me. 2009-01-15 10:02:41 +00:00
Andy Staudacher e53916dd06 Simplifying the way t() is called. Refactoring localization function t($message, $options=array()) into 2 separate functions:
- the new t($message, $options=array()) is for simple strings, optionally with placeholder interpolation.
- t2($singular, $plural, $count, $options=array()) is for plurals.
2009-01-15 09:30:15 +00:00
Bharat Mediratta f3ba69c1d6 Make sure that helper functions are all static. Add new
File_Structure_Test to make sure we don't regress.

According to the PHP docs, the "public" keyword is implied on static
functions, so remove it.  Also, require private static functions to
start with an _.

http://php.net/manual/en/language.oop5.visibility.php
2009-01-14 04:12:02 +00:00
Andy Staudacher a631fe29f3 i18n refactoring: Rename all _() (reserved by gettext) calls to t().
- And refactor printf to our string interpolation / pluralization syntax
- Also, a slight change to the translations_incomings table, using binary(16) instead of char(32) as message key.
2009-01-08 17:13:06 +00:00
Bharat Mediratta 8eb25fbb47 Rebuild 2 images at a time. 2009-01-07 00:57:08 +00:00
Bharat Mediratta 393273eaef Add graphics::Can() to let us determine whether the active toolkit
supports a given function.  Right now it's hardcoded to support what
we know about GD.
2009-01-06 09:30:32 +00:00
Bharat Mediratta 57be3cd78b Add graphics::rotate 2009-01-03 05:25:52 +00:00
Bharat Mediratta a481a684b6 Add a "Graphics Settings" page that lets admins choose which graphics
toolkit we use.  We only allow users to use one toolkit.  The UI needs
work!
2008-12-30 04:14:57 +00:00
Bharat Mediratta 96a2f929ca More phodoc cleanup. 2008-12-30 01:43:16 +00:00
Bharat Mediratta 564bde5c49 comment cleanup. 2008-12-30 01:41:36 +00:00
Bharat Mediratta 4439ca94a9 Don't let the x/y coordinates in composite go negative. 2008-12-29 23:12:26 +00:00
Bharat Mediratta 29c925a3cc Properly implement graphics::composite() 2008-12-29 22:31:06 +00:00
Bharat Mediratta 2bfddc4c87 Make graphics rules take named parameters. This will give us some
flexibility in the future.
2008-12-29 20:20:10 +00:00
Bharat Mediratta b46bfdd492 Separate permanent messages out of the message helper and put them
into site_status.  Show site status in the header in the admin theme.
2008-12-29 00:35:31 +00:00
Bharat Mediratta ed8689f768 Expand on the maintenance code to make it more robust and give the
admin more control.  You can now track running tasks, resume stalled
tasks, cancel running tasks, and remove finished tasks.

Added graphics::compose() as a placeholder for future watermark
operations.

Added CSRF protection to maintenance urls.
2008-12-28 23:48:15 +00:00
Bharat Mediratta 74d4e7d505 First round of a task framework. Tasks are job definitions stored in
the database.  They're started with admin/maintenance/start/[task_name]
which sends down some JS/HTML which regularly pings the task at
admin/maintenance/start/[task_id] until its done.

The UI is still very rough.  It works, though!
2008-12-28 10:12:41 +00:00
Bharat Mediratta 9904c0e5ff Ignore resizes for albums when calculating the dirty count 2008-12-27 03:37:09 +00:00
Bharat Mediratta dee20ed6a2 Added the concept of "permanent" messages that we show to admins. Use
this to show a "your thumbs/resizes are out of date" message whenever
we change the graphics rules.  Tweak watermark module to add graphics
rules whenever we make a change, which triggers the graphics module to
add the permanent message.
2008-12-26 05:43:06 +00:00
Bharat Mediratta e31ca19a06 Added graphics::mark_all_dirty(). The watermark code now marks images
as dirty if the admin changes the watermark at all.
2008-12-26 04:52:18 +00:00
Bharat Mediratta 360fbda04c Only clear the dirty bit if we updated the specific target. 2008-12-23 04:46:13 +00:00
Bharat Mediratta 2502240ce4 Add very simple graphics toolkits.
Track a set of rules in Graphics_Rule_Model which specify how we turn
original images into thumbnails and resizes.  There's one set of rules
that applies to every image in the Gallery.

Track the state of thumbs and resizes with a "dirty" bit.  The new
graphics helper manages the rules and can rebuild the thumbs and
resizes for any images that are considered "dirty".

Introduce the concept of an "album cover" which is an item that an
album points to.  We'll use that item as the source for the album's
thumbnail/resize.

Conflated with this change (sorry!) I also changed the Var table to
use module_name instead of module_id.  This may be marginally less
efficient, but it's much easier to follow in the database.
2008-12-23 04:14:07 +00:00