From Fedora Project Wiki
No edit summary
No edit summary
Line 75: Line 75:
     <nowiki>We initially detect the resolution of the monitor used by the user as mentioned above.There will also be a drop down arrow that gives the users the resolution of the image that they want to be downloaded. This will contain various other resolution options.To make the original picture available for the resolution chosen, it is necessary to first resize the image to the required resolution by using an appropriate method. Since nuancier uses the new python imaging library ‘pillow’ instead of PIL, we can use the ‘resize’ method to change it to the required resolution.
     <nowiki>We initially detect the resolution of the monitor used by the user as mentioned above.There will also be a drop down arrow that gives the users the resolution of the image that they want to be downloaded. This will contain various other resolution options.To make the original picture available for the resolution chosen, it is necessary to first resize the image to the required resolution by using an appropriate method. Since nuancier uses the new python imaging library ‘pillow’ instead of PIL, we can use the ‘resize’ method to change it to the required resolution.


     im = Image.open(<Image name>)
     *im = Image.open(<Image name>)
 
     *im1 = im.resize((x, y), PIL.Image.LANCZOS)
     im1 = im.resize((x, y), PIL.Image.LANCZOS)
     *where, x * y is the resolution of the image selected.
 
     where, x * y is the resolution of the image selected.
</nowiki>
</nowiki>
However, since changing the resolution by too much will result in distortion of image, it will be wise to put some restriction on the maximum extent to which an image can be resized. This can be “associated” with the code that determines the number of monitors for which a wallpaper is available which will also give an idea for the maximum resolution that the image can achieve. May be, we can use the “ImageEnhance” module of “pillow” to adjust the sharpness. brightness and contrast of the image a bit. There also seems to be a tool named “Flask-images” , which can be used to provide dynamic image resizing for the application. May be, we can use either “pillow” or “Flask-images” for this purpose, which I plan to discover during the community-bonding period after discussing with the mentors, if I get selected.
However, since changing the resolution by too much will result in distortion of image, it will be wise to put some restriction on the maximum extent to which an image can be resized. This can be “associated” with the code that determines the number of monitors for which a wallpaper is available which will also give an idea for the maximum resolution that the image can achieve. May be, we can use the “ImageEnhance” module of “pillow” to adjust the sharpness. brightness and contrast of the image a bit. There also seems to be a tool named “Flask-images” , which can be used to provide dynamic image resizing for the application. May be, we can use either “pillow” or “Flask-images” for this purpose, which I plan to discover during the community-bonding period after discussing with the mentors, if I get selected.

Revision as of 18:39, 27 March 2015

Contact Information

  • Email Address:hrudayranjansahoo0208@gmail.com
  • Blog URL:
  • Freenode IRC Nick:python_user

NOTE: We require all students to blog about the progress of their project. You are strongly encouraged to register on the Freenode network and participate in our IRC channels. For more information and other instructions contact Org Admins.

please answer following questions


Project Proposal:


Implementing Download and Uploading for the multi monitor setup 1) Downloading

After considering [2], I found out that for implementing the downloading facility, the following basic steps must be followed:

   Getting the resolution of the monitor/browser of the client.
   Considering the original resolution of the image.
   Considering the no. of monitors for which the original image is available.
   Somehow using the original resolution of the image to make resolutions for multiple displays.(As in [2] and [3]).
   Downloading the image either with the help of a secondary tool or by simple download procedures.


1) Getting the resolution of the monitor/browser of the client

Javascript can be used for this purpose. As per [4], Javascript provides the following method for determining the resolution of the monitor:

   var width = screen.width;
   var height = screen.height;

But Javascript also has the following method that can be used for this purpose:

   window.screen.availHeight;
   window.screen.availWidth;

So, it seems that using either of the option will give us the resolution of the client/browser.


2) Considering the original resolution of the image

Can be easily found out using the uploaded image.


3) Considering the no. of monitors for which original image is available.

The first method considers asking the user for the number of monitors that he/she wants the wallpaper to be available for. However, in my opinion, it is not a good idea as the user might enter wrong information which will further require us to validate the input. But this also has the benefit of forcing the user to enter the correct number of monitors since if the user enters the wrong information, then the wallpaper won’t get much votes. We can include this option if the mentors want it after discussing this with them during the community bonding period.


The second method is determining it automatically. The no. of monitors for which the original image is available can be determined using a combination of image size and aspect ratio. For example, if a user uploads an image of square shaped size and having resolution 2500 x 2500, then it is more suitable for a single monitor. And if the image has the resolution of 5000 x 2500, then it is, most probably, suitable for a horizontal dual monitor setup. The actual width and height of the image (in pixels) also plays a factor in deciding the no. of monitors for which it is to be valid. For example, an image having resolution 7000 x 2500 is most probably suitable for a triple-monitor setup although the aspect ratio is less than 3. Moreover, it is also necessary to provide necessary wallpaper resolutions for a vertical set up of the monitors. All of these criteria can be decided by discussing with the mentors and the concerned officials of Fedora. So, we have to develop an algorithm that determines the number of monitors that can be used (and whether they should be in the vertical or horizontal direction) based on the resolution of the image.


4) Somehow using the original resolution of the image to make resolutions for multiple displays

   We initially detect the resolution of the monitor used by the user as mentioned above.There will also be a drop down arrow that gives the users the resolution of the image that they want to be downloaded. This will contain various other resolution options.To make the original picture available for the resolution chosen, it is necessary to first resize the image to the required resolution by using an appropriate method. Since nuancier uses the new python imaging library ‘pillow’ instead of PIL, we can use the ‘resize’ method to change it to the required resolution.

    *im = Image.open(<Image name>)
    *im1 = im.resize((x, y), PIL.Image.LANCZOS)
    *where, x * y is the resolution of the image selected.

However, since changing the resolution by too much will result in distortion of image, it will be wise to put some restriction on the maximum extent to which an image can be resized. This can be “associated” with the code that determines the number of monitors for which a wallpaper is available which will also give an idea for the maximum resolution that the image can achieve. May be, we can use the “ImageEnhance” module of “pillow” to adjust the sharpness. brightness and contrast of the image a bit. There also seems to be a tool named “Flask-images” , which can be used to provide dynamic image resizing for the application. May be, we can use either “pillow” or “Flask-images” for this purpose, which I plan to discover during the community-bonding period after discussing with the mentors, if I get selected.

   It is also necessary to partition the image into multiple parts like [2] because of the following reasons:

To display thumbnails to the user of how the image will look when displayed on multiple monitors, each of the selected resolution.

Then the image can be downloaded as in point 5) below.


5) Downloading the image either with the help of a secondary tool or by simple download procedures.

Since a user uses a third party tool like “displayfusion” (or the inbuilt facilities in WIndows) to actually spread the wallpaper across multiple monitors, it seems that the download can be facilitated without the help of any third party software as the user has to simply download the image of the requisite resolution and the third party software (or Windows) will actually take care of spreading the image across multiple monitors.


2) Uploading

Fedora currently supports the “uploading” option. I believe that this option can be used also for the uploading of images for multi monitor setup as I am not able to see my possibility of a multi monitor setup causing any trouble for uploading. It seems that the processing need to be done at the server side. However, there can be a restriction that for an image to be eligible for multi monitor setup, it should have a minimum resolution. Currently, nuancier restricts the minimal image resolution to 1600 x 1200. However, if we decide to ask the user to input the number of monitors for which the user wants to make the image available for, then we need to have different minimum resolutions for different multi monitor set ups. But, there might be certain other restrictions and hurdles, which I plan to discover during the community bonding period of GSoC by discussing with the mentors. I want to improve the uploading facility in the following ways:

   Enabling the uploader to associate certain pre-defined (or self-created) tags for the images so that searching using tags becomes easier.
   Asking the user for specify the number of monitors for the images, if decided to implement.


Implementing the GUI for this purpose:

Nuancier uses “Flask” for running its web app which uses the “Jinja” templating engine to render the templates. In the ‘mocks up’ folder of the nuancier source code, the location for the “Download” option is shown to be present at the bottom of the enlarged display of the image when the user clicks on it.

This seems to be a a very good position to place the option. However, in my opinion, it would be better if the “Download” option were replaced by a link to a web page containing various information about the image like [2]. Currently there does not seem to be a separate web page for the display of the information related to a particular image. Implementing this webpage can be very beneficial to a user. This web page can contain the following information among others:

   The image
   The resolutions of the image that the user wants to download the image in.
   A set of thumbnails that gives the user a preview of what it would look like for the selected resolution of the image to be displayed across multiple monitors.
   A “Download” option for the image.
   An (optional) “Voting” option for the image.

Implementing this web page requires knowing and working with the “Jinja” templating engine. For this to work, the corresponding template for the web page should be present in the “template” subdirectory of the “nuancier” directory, as are present the other html templates for the project. I am planning to write the code in the “ui.py” module present in the "nuancier" directory in the following manner (and by using the “koji.css” and “nuancier.css” styles):

   @APP.route(‘/images/<int:: wallpaper_id>’)
   @fas_login_required
   // function definition

In case I am selected, I am also planning to implement extra features like displaying various stats related to the usage of the image such as downloads, clicks etc after discussing with the mentors. To implement this, I plan to design the statistics by following the code written to display the statistics of the elections.


Schedule of Deliverables / Timeline:

The final deliverable of the project will be a system where the users will be able to download and submit wallpapers for multi monitor setup.

I am planning to spend about 5 to 6 hours, on average, on this project per day during my summer vacation. However, the summer vacation in my institute begins on 12th of July whereas the GSoC coding period begins on 25th of May 2015. So, for the initial phase of the GSoC, I will be working at only half of my potential, preferably for about 3 to 4 hours per day. Once the summer vacation begins however, I will be working for the above mentioned number of hours.

Since GSoC will announce the list of selected students on 27th of April, the following is my schedule of deliverables starting from 27th of April onwards:


27th April to 24th May (28 days):

   Getting more involved with the Fedora community
   Discussing more about the scope of the project with the mentors.
   Learning more about the troubles that users might be facing while uploading wallpapers from a multi monitor setup after discussing with the mentors of the project.
   Becoming more fluent in using Flask, SQLAlchemy. I am planning to do this by following the official documentation, and some online tutorials.
   Becoming well verse with the source code and the different use cases of Nuancier.


25th May to 31st May (7 days):

   Figuring out the best way to modify the existing source code to add the code for the “download” and “upload” features, the idea of which I would have gained during the community bonding period by discussing with the mentors and figuring out the algorithm for determining the number of monitors for which an image can be used.


1st June to 11th June (11 days):

   Writing code for implementing the “downloading” facility for wallpapers.


12th June to 14th June (3 days):

   Travelling to my home from my institute. During this time, It will be difficult for me to work on the project and I can work only for 2 to 3 hours per day at max. on the project, trying to write code for implementing the “downloading” facility for wallpapers..


15th June to 23th June (9 days):

   Writing the remaining code for implementing the “downloading” facility for wallpapers.
   Writing, as much as possible, the code for displaying separate web pages for the wallpapers.


24th June to 26th June (3 days):

   Preparing for mid-term evaluations of Google.


27th June to 3rd July (7 days):

   Writing the remaining code for displaying separate web pages for the wallpapers.


4th July to 11th July (7 days):

   Writing code for implementing separate databases(or tables) for storing information about wallpapers.


8th July to 22nd July (15 days):

   Writing code for implementing the “upload” facility for wallpapers for multi monitor setup, if required and any other extra features that are to be implemented, decided during the community bonding period .


23rd July to 5th August (15 days):

   Writing unit tests for checking that the code written does not break the existing code and is implemented as correctly as possible. Also ensuring that maximum coverage of the code is obtained.


6th August to 10th August (5 days):

   Ensuring that the code is PEP8 compliant and follows the general coding structure for implementing Fedora’s applications. Creating some documentation for the new feature of Nuancier, if required.


11th August to 16th August (6 days):

   Ensuring that every feature is implemented and running some trial runs on the applications.


17th August (and probably till 20th August) (1 to 4 days):

   Suggested Pencils down deadline.Improving the documentation and making minor changes, if required.


21st August:

   Submitting final evaluations to Google.

References:

[1] http://www.wallpaperfusion.com/

[2] http://www.wallpaperfusion.com/Image/grass-field/22158/

[3] http://www.mandolux.com

[4] http://stackoverflow.com/questions/2242086/how-to-detect-the-screen-resolution-with-javascript


Why do you want to work with the Fedora Project?

The following are the reasons why I want to do this project:

  • I actually like the idea of this project. Frankly speaking, I have very limited experience with multi monitor set ups. So, getting to know the pros and cons of multi monitor set ups and writing code for the same will be a very good experience for me.
  • Since I am new to the open source community and because I like this concept, I want to develop my understanding of the open source community better by participating in the project

I really like the idea of this project a lot. Fedora is very much known in the open source world for its support to end users and the quality of its products. So, I am very much eager to become a part of the Fedora community and develop my programming skills and improve the understanding of the open source community through the guidance of the mentors and the Fedora community.

Do you have any past involvement with the Fedora project or any other open source project as a contributor?

Frankly speaking, I dont have any past involvement with the Fedora project. I am relatively new to open source world. In fact, I started getting involved with the open source community about 3 months ago. So, I want to increase my involvement in the open source community through this project.

Did you participate with the past GSoC programs, if so which years, which organizations?

This is for the second time that I am applying to GSoC. I had applied for GSoC last year but was not selected and so was not able to take part in the GSoC.


Will you continue contributing/ supporting the Fedora project after the GSoC 2015 program, if yes, which team(s), you are interested with?

Yes, I will continue contributing/ supporting the Fedora project after the GSoC 2015 program. I want to contribute to the Fedora OS and help in the development of Nuancier.


Why should we choose you over other applicants?

I have been coding in Python for about a while now and I am quite familiar with the rules and syntaxes of a Python code. So, it will not be difficult for me to decode to a python code. Moreover, I have experience in writing unit tests for Python modules. So, I am quite familiar with modules like ‘unittest’, ‘mock’, ‘logging’, ‘argparse’ etc. So, I feel that I will be able to complete this project in time. Moreover, being in the 3rd year of Computer Science and Engineering, I feel that I have enough knowledge to find a solution to the project.

I am sincere, hard working and most importantly, I like coding and want to improve my coding skills.