croptool | cropping images at Wikimedia Commons
kandi X-RAY | croptool Summary
kandi X-RAY | croptool Summary
CropTool is a tool for cropping image files at Wikimedia Commons and other Wikimedia sites using the MediaWiki API with OAuth. Help page on Commons.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Publish a Wiki page .
- Handles the callback request .
- Get crop coordinates
- Perform a single scan direction .
- Configure the container .
- Fetch data from the remote server
- Makes calls to the API
- Read metadata from file
- Get info of a PNG file .
- Extract a page from a given page .
croptool Key Features
croptool Examples and Code Snippets
Community Discussions
Trending Discussions on croptool
QUESTION
I'm developing my own picture viewer and in the process of creating an image cropping method. It does work with my current code. However, the application is dynamically resizing the image to fit the user's screen. So when it is resized, the calculated X.Y coordinates of the image are incorrect. I'm not very good at math, so I don't know how to calculate that.
This is the code that I am using
...ANSWER
Answered 2020-Jun-15 at 23:04If I understand this: you've calculated a ratio named aspectRatio
to scale the image from it's actual size to the size of the screen. You have a cropping tool that gives you coordinates based on the scaled size image, and you want to convert those coordinates so they can be applied to the image's original size.
Assuming the above is right, this should be simple.
If the scaled height and width are calculated by:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install croptool
Request an OAuth 1.0 consumer at https://meta.wikimedia.org/wiki/Special:OAuthConsumerRegistration/propose with
Callback URL: https://localhost:7878/
Allow consumer to specify a callback in requests
Grants: "Edit existing pages", "Create, edit, and move pages", "Upload new files" and "Upload, replace, and move files"
Copy config.dist.ini to config.ini and add the consumer token and secret token to config.ini
Install dependencies using Composer and NPM:
Build the frontend:
Generate secret for encrypted cookies:
Start the development server on https://localhost:7878/
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page