102 Commits

Author SHA1 Message Date
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
Brett Smith
176f207b63 small readability improvements in resize_image 2012-03-18 09:35:14 -04:00
Brett Smith
063670e9b4 Refactor image resize code, with better filenames (#261)
The code to make thumbnail- and medium-sized images in processing.py is
pretty similar, so I rolled that out into a separate function that we call
with different arguments as appropriate.

The new function should work identically to the old code, except it saves
images with filenames based on the original filename, like
`foobar.medium.jpg` instead of just `medium.jpg`.  This fixes bug #261.
2012-03-17 23:43:46 -04:00
Christopher Allan Webber
2f5ce68c6c Make mediagoblin SQL models all use a consistent table naming scheme 2012-03-17 16:56:23 -05:00
Bassam
0f8221dca4 fix for ticket #404 2012-03-15 12:13:44 -04:00
Elrond
497d927983 Fix uploading of images (sql: media_data, exif).
When uploading a new image the processing code wants to set
the media_data['exif'] part. As exif is not yet in sql,
there is no way to make this work now. So the workaround is
to check for "no row exists yet" and just ignore exif.
2012-03-15 12:38:09 +01:00
Elrond
36ccc57bea Add gps_altitude and gps_direction to image media_data. 2012-03-14 21:17:50 +01:00
Elrond
ea200c32ac Change image processing to create new .gps_*.
The processing should also create .gps_* instead of the old
['gps']['x']. To ease forward porting, use the new
media.media_data_init() to set the gps data in the media.
2012-03-14 20:17:49 +01:00
Elrond
dd0799ad0a Better media_data sql table for images.
1. Change to the current primary key = media_entry id
   layout
2. Add gps_{latitude,longitude} to the table.
2012-03-12 21:21:35 +01:00
Christopher Allan Webber
8bc894e82b Added m4v to list of media types and a comment stating we should
autogenerate extension list
2012-03-12 13:38:22 -05:00
Joar Wandborg
9743ce886a Replaced 'not foo == None' with 'foo is not None' in ascii sniffing too 2012-03-08 23:49:41 +01:00
Joar Wandborg
e2007352f5 Clean up the workbench after audio processing 2012-03-08 23:03:52 +01:00
Joar Wandborg
e2caf5743c Changed not foo == None to foo is not None in image sniff handler
>>> class foo(object):
       def __eq__(self, other):
           return True

  >>> f = foo()
  >>> f == None
  True
  >>> f is None
  False

-- <http://stackoverflow.com/questions/26595/is-there-any-difference-between-foo-is-none-and-foo-none>
2012-03-08 22:58:16 +01:00