114 Commits

Author SHA1 Message Date
Christopher Allan Webber
6af6bc05bb We don't need to save entries during processing... also adding comments explaining such 2012-12-12 10:14:24 -06:00
Sebastian Spaeth
5f8b4ae895 make media_manager a property of MediaEntry in mixin.py
In all cases where get_media_manager(_media_type_as_string) was called in
our code base we ultimately passed in a "MediaEntry().media_type" to get
the matching MEDIA_MANAGER. It so makes sense to make this a function of
the MediaEntry rather than a global function in mediagoblin.media_types and
passing around media_entry.media_type as arguments all the time.

It saves a few import statements and arguments. I also made it so the
Media_manager property is cached for subsequent calls, although I am not too
sure that this is needed (there are other cases for which this would make
more sense)

Also add a get_media_manager test to the media submission tests. It submits
an image and checks that both media.media_type and media.media_manager
return the right thing. Not sure if these tests could not be merged with an
existing submission test, but it can't hurt to have things explicit.

TODO: Right now we iterate through all existing media_managers to find the
right one based on the string of its module name. This should be made a simple
dict lookup to avoid all the extra work.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-04 15:15:41 +01:00
Christopher Allan Webber
e7e435342a Switch stl processing over to using the workbench
Previously this was writing directly to the public store... that won't
work with cloudfiles backend, for example :)
2012-12-03 14:40:49 -06:00
Christopher Allan Webber
c31a501066 Correcting minor typo in exception string: Empyt->Empty 2012-12-03 14:40:49 -06:00
Christopher Allan Webber
7b8af389a9 Removing unused conversions subdir 2012-12-03 14:40:49 -06:00
Christopher Allan Webber
39c340f280 Moving blender render files to be accessed via pkg_resources
Previously the .blend and .py files had to be in the same directory
mediagoblin/celery launched from.  This is now fixed so it pulls them
out of the package proper.
2012-12-03 14:40:48 -06:00
Aeva Ntsc
de69f43aab Fixed the binary stl loader. 2012-12-03 14:40:48 -06:00
Aeva Ntsc
d25ed5dd4c Added a table to store the file extension of a model. 2012-12-03 14:40:48 -06:00
Aeva Ntsc
12a104671d Added preview rendering for a bunch of different shots. 2012-12-03 14:40:48 -06:00
Aeva Ntsc
ecee8d62c1 Catching ValueError when trying to use ObjModel on binary stl files. 2012-12-03 14:40:48 -06:00
Aeva Ntsc
76918e52e0 Added the stl/obj mediatype. 2012-12-03 14:40:47 -06:00
Sebastian Spaeth
2e4ad35962 Simplify/Robustify the thumbnail URL usage in templates
So far templates required a very complex blurb to simply insert a
thumbnail URL, exposing much of the internal logic to the template
designer. In addition, we would fail with an error if for some
reason the media_files['thumb'] entry was never populated.

This adds the MediaEntry.thumb_url property that template designers
can simply use. It will do the right thing, either fetching the proper
thumbnail or hand back a generic icon specified in a media's
MEDIA_MANAGER as "default_thumb".

Add an image default fallback icon (stolen from Tangos, which are
Public Domain since version 0.8.90 as I understand) since the one
we referred to was not existing. Perhaps, a "broken image" icon
would be better, but I'll leave that to our capable designers.

All templates have been modified to make use of the new thumb_url
function.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-11-15 12:01:31 +01:00
Joar Wandborg
e4a1b6d22a Added VideoThumbnailerMarkII
- Set video.processing to use VideoThumbnailerMarkII.
2012-10-02 16:56:29 +02:00
Joar Wandborg
f1d06e1d6c Switch from webob.Request to werkzeug.wrappers.Request 2012-09-29 21:08:20 +02:00
Joar Wandborg
4f8508f664 Removed logging entry from sniff_handler
The logging entry caused the submit page to crash if you tried to upload
an SVG with a non-ascii filename.
2012-09-22 14:19:51 +02:00
Joar Wandborg
549000d991 Audio support now creates OGG instead of WAV
While creating the spectrogram, and alternative version of the audio
file has been needed. Before this, it has been a WAV format file, the
issue with WAV is that it takes a lot of space. Starting with this it
will be an OGG file.

Rejoice :)
2012-08-12 01:57:00 +02:00
Joar Wandborg
6471291575 Panel improvements
- Added progress meter for video and audio media types.
- Changed the __repr__ method of a MediaEntry to display a bit more
  useful explanation.
- Added a new MediaEntry.state, 'processing', which means that the task
  is running the processor on the item currently.
- Fixed some PEP8 issues in user_pages/views.py
- Fixed the ATOM TAG URI to show the correct year.
2012-07-11 00:36:42 +02:00
Joar Wandborg
51eb0267d9 Minor improvements to the processing panel
- It is now possible to actually see what's processing, due to a bug fix
  where __getitem__ was called on the db model.
- Removed DEPRECATED message from the docstring, it wasn't true.
2012-07-10 18:13:02 +02:00
Brett Smith
81d3c4cf1c Merge branch 'master' into 201207-testfixes 2012-07-08 11:07:02 -04:00
Brett Smith
5bd0adebd0 Prevent non-Unicode SQLAlchemy warnings in most submission tests.
This commit  makes test_submission mostly warning-clean.
2012-07-08 10:04:06 -04:00
Joar Wandborg
9c6f6b78f4 Removed .ogg extension from audio MEDIA_MANAGER.
There is some historical controversy about the .ogg extension and what
you should expect from it. It's better to let the audio and video
plugins take the sniffing-based route to find out what it really seems
to be.
2012-07-06 22:42:31 +02:00
Joar Wandborg
c72d661bed Fixed EXIF longitude bug
- Negative or 'W' longitudes were not accounted for.
- pyflakes fixes.
2012-06-23 17:21:22 +02:00
Will Kahn-Greene
a855e92a98 Fix problems from pyflakes output 2012-06-03 15:53:34 -04:00
Jakob Kramer
b781c3c928 added support for original audio download; rename
Renamed `ogg' to `webm_audio' in core__file_keynames
2012-05-20 18:32:56 +02:00
Joar Wandborg
577ae8a8e1 Removed commented out pdb.set_trace 2012-04-09 20:50:43 +02:00
Joar Wandborg
196a518132 Media processing, transcoding, display fixes
- Added configurable options
  - Video
    - vp8_quality
    - vp8_threads
    - vorbis_quality
  - Audio
    - spectrogram_fft_size
  - ASCII
    - thumbnail_font
- Cleaned up ascii.asciitoimage
- Cleaned up video.transcoders
- Changed default video quality settings to better quality
- Changed default audio spectrogram solution to the double.
- Added a hacky notice for Firefox users instead of the broken range
  input.
2012-04-09 16:28:46 +02:00
Joar Wandborg
9fb336fdc2 Added pygst.require('0.10') since it's absence breaks stuff 2012-03-30 17:50:56 +02:00
Joar Wandborg
ab0d5b59ab Cleaned up media_types.video.transcoders 2012-03-29 23:53:05 +02:00
Joar Wandborg
450ea6094d Merge branch 'master' of gitorious.org:mediagoblin/mediagoblin 2012-03-29 23:01:40 +02:00
Joar Wandborg
ff3136d0e8 Cleanded up video imports, removed PyGTK dependency 2012-03-29 22:52:39 +02:00
Elrond
c45dfee61e Audio: And add empty migrations. 2012-03-29 21:52:26 +02:00
Elrond
c7cf6235fe Audio: Add models and disable media_data.
1. Add a super-minimal media_data table for audio.
   It currently contains nothing.
   Like the ascii one.

2. To avoid media_data trouble -- for now -- disable the
   creation of media_data completrly.
2012-03-29 21:45:05 +02:00
Elrond
02f07bfe14 411: Add relationship and backrefs to media_data tables.
Adding proper relationship()s and especially backref()s
will delete media_data rows along with the main MediaEntry.
This fixes #411.
2012-03-28 13:21:47 +02:00
Joar Wandborg
352a180765 Changed audio.* Image* imports
so that they no longer import from PIL explicitly.
This is due to explicit PIL.Image* imports failing
on a Ubuntu machine within virtualenv.

PIL is a mystery I have yet to find the energy to unravel.

The 'implicit' approach works both for the affected
machine and my local machine and I've seen it more often
out in the wild, so I'm assuming it is the right way.
2012-03-27 23:43:15 +02:00
Joar Wandborg
deea3f6661 Merge remote-tracking branch 'joar/audio+sniffing'
Conflicts:
	mediagoblin/media_types/image/processing.py
	mediagoblin/media_types/video/__init__.py
	mediagoblin/media_types/video/processing.py
	mediagoblin/tests/test_submission.py
2012-03-27 12:05:09 +02:00
Christopher Allan Webber
d0cb752992 Removing superfluous whitespace 2012-03-26 15:11:05 -05:00
Christopher Allan Webber
c051615889 Merge remote-tracking branch 'remotes/slikdigit/bassam'
Conflicts:
	mediagoblin/media_types/image/processing.py
2012-03-26 15:09:35 -05:00
Brett Smith
c16b819663 Merge remote branch 'origin/master' into bug261-resized-filenames
This merge involved moving the new FilenameBuilder class to
processing/__init__.py, and putting the comment deletion tests back into
test_submission.py using the refactored functions.
2012-03-26 14:10:22 -04:00
Brett Smith
28f364bd6d Rename to FilenameBuilder, with a main method named fill.
I think these names better convey what's actually going on.  I updated the
documentation a bit while I was at it.
2012-03-26 13:40:35 -04:00
Joar Wandborg
c56d4b55a1 Media type refractors, pep8, lint
- Removed THUMB_SIZE, MEDIUM_SIZE constants, depend on
  configuration values instead.
- pep8 refractoring
2012-03-26 17:44:08 +02:00
Brett Smith
84725abd64 Refactor video processing to use FilenameMunger. 2012-03-25 13:32:25 -04:00
Brett Smith
ab35ad4605 Use FilenameMunger. 2012-03-25 13:26:57 -04:00
Elrond
f7ab2f42ea Do not fill media_data['exif'] any more. 2012-03-25 14:42:03 +02:00
Elrond
763ef5b77e Start to fill media_data.exif_all in addition.
In addition to filling the normal slot media_data['exif'],
now also fill media_data.exif_all. This is the new slot
used by SQL.
For a few moments this will create duplicated entries in
the mongo db. But this shouldn't hurt.
2012-03-25 14:12:53 +02:00
Elrond
e0b0588fb1 image_mediadata: Add exif_all column 2012-03-23 19:22:28 +01:00
Elrond
e0e7232af9 Add copyright header to image/models.py 2012-03-23 19:22:28 +01:00
Joar Wandborg
a9d84d4cb7 Faster sniffing
- Sniffing now goes through the old extension-based filter before
  doing it the bitsniffing way.
- Refractored get_media_type_and_manager(filename).
- Removed ogg extension from video accepted extensions, audio
  will take care of that.
- Added custom audio player, still WIP,but working.
- Added test for sniffing. This only tests for the
  mediagoblin.media_types.image type, as that is the only
  one enabled from start.
2012-03-22 01:27:19 +01:00
Elrond
8fd81053b4 More standard media_data model for ascii.
ascii doesn't use media_data at all. So it needs the most
basic media_data model. Fix it to take the current form.
2012-03-20 23:55:28 +01:00
Elrond
39fd817ab8 Import "Base" from base instead of models.
Import the "Base" class for models from db.sql.base instead
of db.sql.models.
2012-03-20 12:45:40 +01:00
Jakob Kramer
6b45ec1b0c 500 error because of subscripting instead of using attributes 2012-03-18 22:28:22 +01:00