Provide a well-performing API to rotate an image

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

Provide a well-performing API to rotate an image

Steinsplitter Wiki
Hi,

I am not sure if this is the correct mailinglist to write.

Every week on commons a bot is rotating hunderts of files, however this bot will stop working soon. In the last years tens of thousands files has been rotated.

Rotating files is a vital feature on commons and therefore indispensable. The bugreport [1] on phabricator is open since three years, but, unfortunately no dev is working on it. The bug has also a lot of +1 (tokens).

I am wonder if it is possible to enable and code review this feature asap.

:-)

Best,
Steinsplitter

[1] https://phabricator.wikimedia.org/T35186
     
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Provide a well-performing API to rotate an image

Brad Jorsch (Anomie)
On Thu, Jul 16, 2015 at 8:26 AM, Steinsplitter Wiki <
[hidden email]> wrote:

> I am wonder if it is possible to enable and code review this feature asap.
>

For clarification, it's not just a matter of "enable and code review". The
existing code, if enabled, will run the rotation on the API servers. For
usage on the WMF cluster, new code must first be written to somehow (e.g.
via the job queue) get the rotate requests from the API servers to the
imagescaler servers.


--
Brad Jorsch (Anomie)
Senior Software Engineer
Wikimedia Foundation
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Provide a well-performing API to rotate an image

Brion Vibber-4
In reply to this post by Steinsplitter Wiki
Out of curiosity what is the problem with the bot that prevents it from
working?

It's entirely possible that fixing the bot is easier than hacking an
internal rotate and reupload feature that runs on the image scalers.

Or... Just making it possible to mark images as needing to be rotated
correctly on output (given we already rotate on thumbnail generation)...

-- brion
On Jul 16, 2015 8:27 AM, "Steinsplitter Wiki" <[hidden email]>
wrote:

> Hi,
>
> I am not sure if this is the correct mailinglist to write.
>
> Every week on commons a bot is rotating hunderts of files, however this
> bot will stop working soon. In the last years tens of thousands files has
> been rotated.
>
> Rotating files is a vital feature on commons and therefore indispensable.
> The bugreport [1] on phabricator is open since three years, but,
> unfortunately no dev is working on it. The bug has also a lot of +1
> (tokens).
>
> I am wonder if it is possible to enable and code review this feature asap.
>
> :-)
>
> Best,
> Steinsplitter
>
> [1] https://phabricator.wikimedia.org/T35186
>
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Provide a well-performing API to rotate an image

Pine W
In reply to this post by Steinsplitter Wiki
Perhaps this should go to Community Tech or Multimedia. Copying to the
Multimedia list.

Pine
On Jul 16, 2015 6:27 AM, "Steinsplitter Wiki" <[hidden email]>
wrote:

> Hi,
>
> I am not sure if this is the correct mailinglist to write.
>
> Every week on commons a bot is rotating hunderts of files, however this
> bot will stop working soon. In the last years tens of thousands files has
> been rotated.
>
> Rotating files is a vital feature on commons and therefore indispensable.
> The bugreport [1] on phabricator is open since three years, but,
> unfortunately no dev is working on it. The bug has also a lot of +1
> (tokens).
>
> I am wonder if it is possible to enable and code review this feature asap.
>
> :-)
>
> Best,
> Steinsplitter
>
> [1] https://phabricator.wikimedia.org/T35186
>
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Provide a well-performing API to rotate an image

Steinsplitter Wiki
In reply to this post by Brion Vibber-4
> Out of curiosity what is the problem with the bot that prevents it from
> working?
It is very old and bad written and needs a complete rewrite.

> It's entirely possible that fixing the bot is easier than hacking an
> internal rotate and reupload feature that runs on the image scalers.
It would be the best solution to fix that function in mediawiki. This would also allow real time rotation.

> Or... Just making it possible to mark images as needing to be rotated
> correctly on output (given we already rotate on thumbnail generation)...
The thumb rotation is not always perfect and the file itself is not rotatet at all.

:-)

> Date: Thu, 16 Jul 2015 08:51:47 -0500
> From: [hidden email]
> To: [hidden email]
> Subject: Re: [Wikitech-l] Provide a well-performing API to rotate an image
>
> Out of curiosity what is the problem with the bot that prevents it from
> working?
>
> It's entirely possible that fixing the bot is easier than hacking an
> internal rotate and reupload feature that runs on the image scalers.
>
> Or... Just making it possible to mark images as needing to be rotated
> correctly on output (given we already rotate on thumbnail generation)...
>
> -- brion
> On Jul 16, 2015 8:27 AM, "Steinsplitter Wiki" <[hidden email]>
> wrote:
>
> > Hi,
> >
> > I am not sure if this is the correct mailinglist to write.
> >
> > Every week on commons a bot is rotating hunderts of files, however this
> > bot will stop working soon. In the last years tens of thousands files has
> > been rotated.
> >
> > Rotating files is a vital feature on commons and therefore indispensable.
> > The bugreport [1] on phabricator is open since three years, but,
> > unfortunately no dev is working on it. The bug has also a lot of +1
> > (tokens).
> >
> > I am wonder if it is possible to enable and code review this feature asap.
> >
> > :-)
> >
> > Best,
> > Steinsplitter
> >
> > [1] https://phabricator.wikimedia.org/T35186
> >
> > _______________________________________________
> > Wikitech-l mailing list
> > [hidden email]
> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
     
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Provide a well-performing API to rotate an image

Dan Garry
Hi Steinsplitter,

On 16 July 2015 at 09:00, Steinsplitter Wiki <[hidden email]>
wrote:

> > Out of curiosity what is the problem with the bot that prevents it from
> > working?
> It is very old and bad written and needs a complete rewrite.
>

That doesn't really answer Brion's question. What would prevent it from
continuing to run while it is being rewritten?

Dan

--
Dan Garry
Lead Product Manager, Discovery
Wikimedia Foundation
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Provide a well-performing API to rotate an image

Brion Vibber-4
In reply to this post by Steinsplitter Wiki
On Thu, Jul 16, 2015 at 9:00 AM, Steinsplitter Wiki <
[hidden email]> wrote:

> > Out of curiosity what is the problem with the bot that prevents it from
> > working?
> It is very old and bad written and needs a complete rewrite.
>

That can be said of many things in our stack. ;) What made it stop working
in the last month, specifically? Can you point us to the source code?


> > It's entirely possible that fixing the bot is easier than hacking an
> > internal rotate and reupload feature that runs on the image scalers.
> It would be the best solution to fix that function in mediawiki. This
> would also allow real time rotation.
>
> > Or... Just making it possible to mark images as needing to be rotated
> > correctly on output (given we already rotate on thumbnail generation)...
> The thumb rotation is not always perfect and the file itself is not
> rotatet at all.
>

Allowing override of the thumb rotation would provide you real time
rotation...

I'm not sure about the need to rotate the original file; ideally original
files should be left as-is and kept archival.

-- brion


>
> :-)
>
> > Date: Thu, 16 Jul 2015 08:51:47 -0500
> > From: [hidden email]
> > To: [hidden email]
> > Subject: Re: [Wikitech-l] Provide a well-performing API to rotate an
> image
> >
> > Out of curiosity what is the problem with the bot that prevents it from
> > working?
> >
> > It's entirely possible that fixing the bot is easier than hacking an
> > internal rotate and reupload feature that runs on the image scalers.
> >
> > Or... Just making it possible to mark images as needing to be rotated
> > correctly on output (given we already rotate on thumbnail generation)...
> >
> > -- brion
> > On Jul 16, 2015 8:27 AM, "Steinsplitter Wiki" <
> [hidden email]>
> > wrote:
> >
> > > Hi,
> > >
> > > I am not sure if this is the correct mailinglist to write.
> > >
> > > Every week on commons a bot is rotating hunderts of files, however this
> > > bot will stop working soon. In the last years tens of thousands files
> has
> > > been rotated.
> > >
> > > Rotating files is a vital feature on commons and therefore
> indispensable.
> > > The bugreport [1] on phabricator is open since three years, but,
> > > unfortunately no dev is working on it. The bug has also a lot of +1
> > > (tokens).
> > >
> > > I am wonder if it is possible to enable and code review this feature
> asap.
> > >
> > > :-)
> > >
> > > Best,
> > > Steinsplitter
> > >
> > > [1] https://phabricator.wikimedia.org/T35186
> > >
> > > _______________________________________________
> > > Wikitech-l mailing list
> > > [hidden email]
> > > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> > _______________________________________________
> > Wikitech-l mailing list
> > [hidden email]
> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Provide a well-performing API to rotate an image

Steinsplitter Wiki
In reply to this post by Dan Garry
> That doesn't really answer Brion's question. What would prevent it from
> continuing to run while it is being rewritten?
lack of time.

> Date: Thu, 16 Jul 2015 09:05:11 -0500
> From: [hidden email]
> To: [hidden email]
> Subject: Re: [Wikitech-l] Provide a well-performing API to rotate an image
>
> Hi Steinsplitter,
>
> On 16 July 2015 at 09:00, Steinsplitter Wiki <[hidden email]>
> wrote:
>
> > > Out of curiosity what is the problem with the bot that prevents it from
> > > working?
> > It is very old and bad written and needs a complete rewrite.
> >
>
> That doesn't really answer Brion's question. What would prevent it from
> continuing to run while it is being rewritten?
>
> Dan
>
> --
> Dan Garry
> Lead Product Manager, Discovery
> Wikimedia Foundation
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
     
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Provide a well-performing API to rotate an image

YiFei
>> That doesn't really answer Brion's question. What would prevent it from
>> continuing to run while it is being rewritten?
> lack of time.
(commenting on this as I tried to debug the code previously)
The code currently:
* is independent from any maintained mw api libraries
* use self defined api parameters
* uses php's curl, which has quite weird https support
* has doc strings in de, which I can't read
* generates tons of php warnings
* and does not check whether upload / page save is successfully done or not

The bot have failed when:
* a few weeks ago from the https switch
* currently from session / token-related issue (not entirely sure)

Rewrite attempts have been made, but:
* the code barely make any sense (not OOP, reduced indentation, tons of bugs, etc.)
* lack of time to do complete rewrite

>
>> Date: Thu, 16 Jul 2015 09:05:11 -0500
>> From: [hidden email]
>> To: [hidden email]
>> Subject: Re: [Wikitech-l] Provide a well-performing API to rotate an image
>>
>> Hi Steinsplitter,
>>
>> On 16 July 2015 at 09:00, Steinsplitter Wiki <[hidden email]>
>> wrote:
>>
>>>> Out of curiosity what is the problem with the bot that prevents it from
>>>> working?
>>> It is very old and bad written and needs a complete rewrite.
>>
>> That doesn't really answer Brion's question. What would prevent it from
>> continuing to run while it is being rewritten?
>>
>> Dan
>>
>> --
>> Dan Garry
>> Lead Product Manager, Discovery
>> Wikimedia Foundation
>> _______________________________________________
>> Wikitech-l mailing list
>> [hidden email]
>> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>                        
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Provide a well-performing API to rotate an image

Gergo Tisza
You would still need to rewrite the bot though, even if there was a
rotation API, wouldn't you?

On Thu, Jul 16, 2015 at 11:19 AM, YiFei <[hidden email]> wrote:

> >> That doesn't really answer Brion's question. What would prevent it from
> >> continuing to run while it is being rewritten?
> > lack of time.
> (commenting on this as I tried to debug the code previously)
> The code currently:
> * is independent from any maintained mw api libraries
> * use self defined api parameters
> * uses php's curl, which has quite weird https support
> * has doc strings in de, which I can't read
> * generates tons of php warnings
> * and does not check whether upload / page save is successfully done or not
>
> The bot have failed when:
> * a few weeks ago from the https switch
> * currently from session / token-related issue (not entirely sure)
>
> Rewrite attempts have been made, but:
> * the code barely make any sense (not OOP, reduced indentation, tons of
> bugs, etc.)
> * lack of time to do complete rewrite
>
> >
> >> Date: Thu, 16 Jul 2015 09:05:11 -0500
> >> From: [hidden email]
> >> To: [hidden email]
> >> Subject: Re: [Wikitech-l] Provide a well-performing API to rotate an
> image
> >>
> >> Hi Steinsplitter,
> >>
> >> On 16 July 2015 at 09:00, Steinsplitter Wiki <
> [hidden email]>
> >> wrote:
> >>
> >>>> Out of curiosity what is the problem with the bot that prevents it
> from
> >>>> working?
> >>> It is very old and bad written and needs a complete rewrite.
> >>
> >> That doesn't really answer Brion's question. What would prevent it from
> >> continuing to run while it is being rewritten?
> >>
> >> Dan
> >>
> >> --
> >> Dan Garry
> >> Lead Product Manager, Discovery
> >> Wikimedia Foundation
> >> _______________________________________________
> >> Wikitech-l mailing list
> >> [hidden email]
> >> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> >
> > _______________________________________________
> > Wikitech-l mailing list
> > [hidden email]
> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Provide a well-performing API to rotate an image

Brion Vibber-4
In reply to this post by Brion Vibber-4
Ok, I've thrown together a preliminary patch to move the actual rotation
for ApiImageRotate to the job queue:

https://gerrit.wikimedia.org/r/#/c/225097/

Haven't had a chance to test it yet, so there's probably a typo or two
still hiding in there.

Steinsplitter, will there be a (more limited) bot hitting this API action,
or will people need a user-interface for it in the near term? It shouldn't
be too hard to rig up some JS buttons...

The primary difficulty I see is with being able to see whether there's a
pending rotation; in case it's delayed you don't want to accidentally queue
up multiple rotations! Once something's fired into the job queue I don't
think we have a good way to query it. (TimedMediaHandler shows queued
transcode jobs, but maintains its own secondary database table to track
them...)


Also, I had a good talk with Trevor at the Wikimania hackathon about
non-destructive image editing; somewhere down the road we should be able to
integrate this sort of thing into the thumbnailing in a way that's more
user-friendly and also allows for cropping and some basic filters.

But I don't think we have to wait on that to help folks out for now by
fixing up the disabled API action...

-- brion


On Thu, Jul 16, 2015 at 9:16 AM, Brion Vibber <[hidden email]> wrote:

> On Thu, Jul 16, 2015 at 9:00 AM, Steinsplitter Wiki <
> [hidden email]> wrote:
>
>> > Out of curiosity what is the problem with the bot that prevents it from
>> > working?
>> It is very old and bad written and needs a complete rewrite.
>>
>
> That can be said of many things in our stack. ;) What made it stop working
> in the last month, specifically? Can you point us to the source code?
>
>
>> > It's entirely possible that fixing the bot is easier than hacking an
>> > internal rotate and reupload feature that runs on the image scalers.
>> It would be the best solution to fix that function in mediawiki. This
>> would also allow real time rotation.
>>
>> > Or... Just making it possible to mark images as needing to be rotated
>> > correctly on output (given we already rotate on thumbnail generation)...
>> The thumb rotation is not always perfect and the file itself is not
>> rotatet at all.
>>
>
> Allowing override of the thumb rotation would provide you real time
> rotation...
>
> I'm not sure about the need to rotate the original file; ideally original
> files should be left as-is and kept archival.
>
> -- brion
>
>
>>
>> :-)
>>
>> > Date: Thu, 16 Jul 2015 08:51:47 -0500
>> > From: [hidden email]
>> > To: [hidden email]
>> > Subject: Re: [Wikitech-l] Provide a well-performing API to rotate an
>> image
>> >
>> > Out of curiosity what is the problem with the bot that prevents it from
>> > working?
>> >
>> > It's entirely possible that fixing the bot is easier than hacking an
>> > internal rotate and reupload feature that runs on the image scalers.
>> >
>> > Or... Just making it possible to mark images as needing to be rotated
>> > correctly on output (given we already rotate on thumbnail generation)...
>> >
>> > -- brion
>> > On Jul 16, 2015 8:27 AM, "Steinsplitter Wiki" <
>> [hidden email]>
>> > wrote:
>> >
>> > > Hi,
>> > >
>> > > I am not sure if this is the correct mailinglist to write.
>> > >
>> > > Every week on commons a bot is rotating hunderts of files, however
>> this
>> > > bot will stop working soon. In the last years tens of thousands files
>> has
>> > > been rotated.
>> > >
>> > > Rotating files is a vital feature on commons and therefore
>> indispensable.
>> > > The bugreport [1] on phabricator is open since three years, but,
>> > > unfortunately no dev is working on it. The bug has also a lot of +1
>> > > (tokens).
>> > >
>> > > I am wonder if it is possible to enable and code review this feature
>> asap.
>> > >
>> > > :-)
>> > >
>> > > Best,
>> > > Steinsplitter
>> > >
>> > > [1] https://phabricator.wikimedia.org/T35186
>> > >
>> > > _______________________________________________
>> > > Wikitech-l mailing list
>> > > [hidden email]
>> > > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>> > _______________________________________________
>> > Wikitech-l mailing list
>> > [hidden email]
>> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>>
>> _______________________________________________
>> Wikitech-l mailing list
>> [hidden email]
>> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>>
>
>
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Provide a well-performing API to rotate an image

Steinsplitter Wiki
In reply to this post by Gergo Tisza
> You would still need to rewrite the bot though, even if there was a
> rotation API, wouldn't you?

No need to rewrite then because Rillke will fix the rotate link java-script. :-)

> Date: Thu, 16 Jul 2015 12:21:10 -0500
> From: [hidden email]
> To: [hidden email]
> Subject: Re: [Wikitech-l] Provide a well-performing API to rotate an image
>
> You would still need to rewrite the bot though, even if there was a
> rotation API, wouldn't you?
>
> On Thu, Jul 16, 2015 at 11:19 AM, YiFei <[hidden email]> wrote:
>
> > >> That doesn't really answer Brion's question. What would prevent it from
> > >> continuing to run while it is being rewritten?
> > > lack of time.
> > (commenting on this as I tried to debug the code previously)
> > The code currently:
> > * is independent from any maintained mw api libraries
> > * use self defined api parameters
> > * uses php's curl, which has quite weird https support
> > * has doc strings in de, which I can't read
> > * generates tons of php warnings
> > * and does not check whether upload / page save is successfully done or not
> >
> > The bot have failed when:
> > * a few weeks ago from the https switch
> > * currently from session / token-related issue (not entirely sure)
> >
> > Rewrite attempts have been made, but:
> > * the code barely make any sense (not OOP, reduced indentation, tons of
> > bugs, etc.)
> > * lack of time to do complete rewrite
> >
> > >
> > >> Date: Thu, 16 Jul 2015 09:05:11 -0500
> > >> From: [hidden email]
> > >> To: [hidden email]
> > >> Subject: Re: [Wikitech-l] Provide a well-performing API to rotate an
> > image
> > >>
> > >> Hi Steinsplitter,
> > >>
> > >> On 16 July 2015 at 09:00, Steinsplitter Wiki <
> > [hidden email]>
> > >> wrote:
> > >>
> > >>>> Out of curiosity what is the problem with the bot that prevents it
> > from
> > >>>> working?
> > >>> It is very old and bad written and needs a complete rewrite.
> > >>
> > >> That doesn't really answer Brion's question. What would prevent it from
> > >> continuing to run while it is being rewritten?
> > >>
> > >> Dan
> > >>
> > >> --
> > >> Dan Garry
> > >> Lead Product Manager, Discovery
> > >> Wikimedia Foundation
> > >> _______________________________________________
> > >> Wikitech-l mailing list
> > >> [hidden email]
> > >> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> > >
> > > _______________________________________________
> > > Wikitech-l mailing list
> > > [hidden email]
> > > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> >
> > _______________________________________________
> > Wikitech-l mailing list
> > [hidden email]
> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> >
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
     
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Provide a well-performing API to rotate an image

MZMcBride-2
In reply to this post by Brion Vibber-4
Brion Vibber wrote:
>Allowing override of the thumb rotation would provide you real time
>rotation...
>
>I'm not sure about the need to rotate the original file; ideally original
>files should be left as-is and kept archival.

In my opinion, we need to solve image rotation as part of a larger project
to support in-browser rasterized image manipulation. A bot shouldn't be
necessary here. We should have the ability, in a Web browser, to crop,
rotate, and make other basic manipulations to rasterized images. The fact
that we have a media repository using software called MediaWiki that
doesn't include an in-browser basic photo editor is pretty silly.

MZMcBride



_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Provide a well-performing API to rotate an image

Brion Vibber-4
On Thu, Jul 16, 2015 at 3:45 PM, MZMcBride <[hidden email]> wrote:

> Brion Vibber wrote:
> >Allowing override of the thumb rotation would provide you real time
> >rotation...
> >
> >I'm not sure about the need to rotate the original file; ideally original
> >files should be left as-is and kept archival.
>
> In my opinion, we need to solve image rotation as part of a larger project
> to support in-browser rasterized image manipulation. A bot shouldn't be
> necessary here. We should have the ability, in a Web browser, to crop,
> rotate, and make other basic manipulations to rasterized images. The fact
> that we have a media repository using software called MediaWiki that
> doesn't include an in-browser basic photo editor is pretty silly.
>

Agreed! Most of that probably should be non-destructive editing that keeps
the original and applies crop/rotate/filters along with thumbnailing as
necessary. That'll take some more infrastructure work though.

Of course if you're going to draw on a picture that'll require uploading a
new version.

-- brion
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Provide a well-performing API to rotate an image

Brion Vibber-4
In reply to this post by Brion Vibber-4
Updated https://gerrit.wikimedia.org/r/225097 with some partial
infrastructure for tracking the status of pending updates (not quite done
yet). ... also a little prep work for future crop and trim transformations.

Comments on the patch or the attached phab ticket please. :D

-- brion

On Thu, Jul 16, 2015 at 12:22 PM, Brion Vibber <[hidden email]>
wrote:

> Ok, I've thrown together a preliminary patch to move the actual rotation
> for ApiImageRotate to the job queue:
>
> https://gerrit.wikimedia.org/r/#/c/225097/
>
> Haven't had a chance to test it yet, so there's probably a typo or two
> still hiding in there.
>
> Steinsplitter, will there be a (more limited) bot hitting this API action,
> or will people need a user-interface for it in the near term? It shouldn't
> be too hard to rig up some JS buttons...
>
> The primary difficulty I see is with being able to see whether there's a
> pending rotation; in case it's delayed you don't want to accidentally queue
> up multiple rotations! Once something's fired into the job queue I don't
> think we have a good way to query it. (TimedMediaHandler shows queued
> transcode jobs, but maintains its own secondary database table to track
> them...)
>
>
> Also, I had a good talk with Trevor at the Wikimania hackathon about
> non-destructive image editing; somewhere down the road we should be able to
> integrate this sort of thing into the thumbnailing in a way that's more
> user-friendly and also allows for cropping and some basic filters.
>
> But I don't think we have to wait on that to help folks out for now by
> fixing up the disabled API action...
>
> -- brion
>
>
> On Thu, Jul 16, 2015 at 9:16 AM, Brion Vibber <[hidden email]>
> wrote:
>
>> On Thu, Jul 16, 2015 at 9:00 AM, Steinsplitter Wiki <
>> [hidden email]> wrote:
>>
>>> > Out of curiosity what is the problem with the bot that prevents it from
>>> > working?
>>> It is very old and bad written and needs a complete rewrite.
>>>
>>
>> That can be said of many things in our stack. ;) What made it stop
>> working in the last month, specifically? Can you point us to the source
>> code?
>>
>>
>>> > It's entirely possible that fixing the bot is easier than hacking an
>>> > internal rotate and reupload feature that runs on the image scalers.
>>> It would be the best solution to fix that function in mediawiki. This
>>> would also allow real time rotation.
>>>
>>> > Or... Just making it possible to mark images as needing to be rotated
>>> > correctly on output (given we already rotate on thumbnail
>>> generation)...
>>> The thumb rotation is not always perfect and the file itself is not
>>> rotatet at all.
>>>
>>
>> Allowing override of the thumb rotation would provide you real time
>> rotation...
>>
>> I'm not sure about the need to rotate the original file; ideally original
>> files should be left as-is and kept archival.
>>
>> -- brion
>>
>>
>>>
>>> :-)
>>>
>>> > Date: Thu, 16 Jul 2015 08:51:47 -0500
>>> > From: [hidden email]
>>> > To: [hidden email]
>>> > Subject: Re: [Wikitech-l] Provide a well-performing API to rotate an
>>> image
>>> >
>>> > Out of curiosity what is the problem with the bot that prevents it from
>>> > working?
>>> >
>>> > It's entirely possible that fixing the bot is easier than hacking an
>>> > internal rotate and reupload feature that runs on the image scalers.
>>> >
>>> > Or... Just making it possible to mark images as needing to be rotated
>>> > correctly on output (given we already rotate on thumbnail
>>> generation)...
>>> >
>>> > -- brion
>>> > On Jul 16, 2015 8:27 AM, "Steinsplitter Wiki" <
>>> [hidden email]>
>>> > wrote:
>>> >
>>> > > Hi,
>>> > >
>>> > > I am not sure if this is the correct mailinglist to write.
>>> > >
>>> > > Every week on commons a bot is rotating hunderts of files, however
>>> this
>>> > > bot will stop working soon. In the last years tens of thousands
>>> files has
>>> > > been rotated.
>>> > >
>>> > > Rotating files is a vital feature on commons and therefore
>>> indispensable.
>>> > > The bugreport [1] on phabricator is open since three years, but,
>>> > > unfortunately no dev is working on it. The bug has also a lot of +1
>>> > > (tokens).
>>> > >
>>> > > I am wonder if it is possible to enable and code review this feature
>>> asap.
>>> > >
>>> > > :-)
>>> > >
>>> > > Best,
>>> > > Steinsplitter
>>> > >
>>> > > [1] https://phabricator.wikimedia.org/T35186
>>> > >
>>> > > _______________________________________________
>>> > > Wikitech-l mailing list
>>> > > [hidden email]
>>> > > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>>> > _______________________________________________
>>> > Wikitech-l mailing list
>>> > [hidden email]
>>> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>>>
>>> _______________________________________________
>>> Wikitech-l mailing list
>>> [hidden email]
>>> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>>>
>>
>>
>
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Provide a well-performing API to rotate an image

Jon Robson
In reply to this post by Brion Vibber-4
Apologies if I'm missing something but is there any reason why we can't do
image rotation on the client using the canvas JavaScript api?

On Thu, Jul 16, 2015 at 3:45 PM, MZMcBride <[hidden email]> wrote:

> Brion Vibber wrote:
> >Allowing override of the thumb rotation would provide you real time
> >rotation...
> >
> >I'm not sure about the need to rotate the original file; ideally original
> >files should be left as-is and kept archival.
>
> In my opinion, we need to solve image rotation as part of a larger project
> to support in-browser rasterized image manipulation. A bot shouldn't be
> necessary here. We should have the ability, in a Web browser, to crop,
> rotate, and make other basic manipulations to rasterized images. The fact
> that we have a media repository using software called MediaWiki that
> doesn't include an in-browser basic photo editor is pretty silly.
>

Agreed! Most of that probably should be non-destructive editing that keeps
the original and applies crop/rotate/filters along with thumbnailing as
necessary. That'll take some more infrastructure work though.

Of course if you're going to draw on a picture that'll require uploading a
new version.

-- brion
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Provide a well-performing API to rotate an image

Steinsplitter Wiki
> Apologies if I'm missing something but is there any reason why we can't do
> image rotation on the client using the canvas JavaScript api?

Client side rotation takes ages, especially with big files.

> Agreed! Most of that probably should be non-destructive editing that keeps
> the original and applies crop/rotate/filters along with thumbnailing as
> necessary.

I suggest that we keep status quo. It has worked perfect for years. Just fixing thumbs does not fix the file itself and we want to have the file itself fixed.

> Date: Fri, 17 Jul 2015 19:30:44 +0800
> From: [hidden email]
> To: [hidden email]
> Subject: Re: [Wikitech-l] Provide a well-performing API to rotate an image
>
> Apologies if I'm missing something but is there any reason why we can't do
> image rotation on the client using the canvas JavaScript api?
>
> On Thu, Jul 16, 2015 at 3:45 PM, MZMcBride <[hidden email]> wrote:
>
> > Brion Vibber wrote:
> > >Allowing override of the thumb rotation would provide you real time
> > >rotation...
> > >
> > >I'm not sure about the need to rotate the original file; ideally original
> > >files should be left as-is and kept archival.
> >
> > In my opinion, we need to solve image rotation as part of a larger project
> > to support in-browser rasterized image manipulation. A bot shouldn't be
> > necessary here. We should have the ability, in a Web browser, to crop,
> > rotate, and make other basic manipulations to rasterized images. The fact
> > that we have a media repository using software called MediaWiki that
> > doesn't include an in-browser basic photo editor is pretty silly.
> >
>
> Agreed! Most of that probably should be non-destructive editing that keeps
> the original and applies crop/rotate/filters along with thumbnailing as
> necessary. That'll take some more infrastructure work though.
>
> Of course if you're going to draw on a picture that'll require uploading a
> new version.
>
> -- brion
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
     
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l