![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
@grapecity/gcimageviewer
Advanced tools
A JavaScript Image viewer and editor that comes with GrapeCity Documents for Imaging.
GrapeCity Documents Image Viewer (GcDocs Image Viewer, GcImageViewer) is a fast modern JavaScript based image viewer and editor that runs in all major browsers. The viewer can be used as a cross platform solution to view or modify images on Windows, MAC, Linux, iOS and Android devices. GcImageViewer is included in GrapeCity Documents for Image (GcImaging), a feature-rich cross-platform Image API library for .NET.
GcImageViewer provides a rich client side JavaScript object model, see docs/index.html for the client API documentation.
Product highlights:
// Example: toggle image animation:
const viewer = GcImageViewer.findControl("#root");
if(viewer.isAnimationStarted) {
viewer.stopAnimation();
} else {
viewer.startAnimation();
}
// Example: create Image Filters plugin:
const imageFiltersPlugin = new ImageFiltersPlugin();
// Remove the default image filters, except for the "Invert" filter:
const filters = imageFiltersPlugin.filters;
for (const filterName in filters) {
if(filterName === "invert")
continue;
delete filters[filterName];
}
// Add custom Image Filter:
filters["lemon-effect"] = {
filterId = "lemon-effect",
toolbarKey: "lemon-effect",
title: "Apply Custom Lemon effect",
text: "Apply Lemon effect",
action: function(imageData) {
for (i = 0; i < imageData.data.length; i += 4) {
imageData.data[i + 1] = imageData.data[i] + 45; // increase green component
}
return imageData;
}
};
// Register Image Filters plugin:
viewer.addPlugin(imageFiltersPlugin);
// Example:
viewer.addPlugin(new PageToolsPlugin());
// Example:
var viewer = new GcImageViewer("#root", { maxImageSize: { width: 1080, height: 1350 } });
// Example:
var viewer = new GcImageViewer("#root", { undo: { skipCommands: ["Open", "Close", "Zoom"] } });
// Example:
var pluginRotate = viewer.findPlugin("rotation");
// Example 1: disable undo storage.
var viewer = new GcImageViewer("#root", { undo: false });
// Example 2: Limit the maximum number of undo levels to 5.
var viewer = new GcImageViewer("#root", { undo: { maxLevels: 5 } });
// Example 3: Create an undoable custom command that changes the opacity of the main viewer element.
var viewer = new GcImageViewer("#root");
function CustomOpacityCommand(opacity) {
if(opacity !== undefined) {
this.opacity = opacity;
}
}
CustomOpacityCommand.prototype = {
opacity: "0.5",
prevOpacity: "",
execute: function(viewer) {
return new Promise((resolve) => {
this.prevOpacity = viewer.hostElement.style.opacity;
viewer.hostElement.style.opacity = this.opacity;
resolve();
})
},
undo: function(viewer) {
return new Promise((resolve)=>{
viewer.hostElement.style.opacity = this.prevOpacity;
resolve();
})
}
};
// Open image:
await viewer.open(https://example.com/download?file=images/image.jpg);
// Clear undo storage:
viewer.clearUndo();
// Execute custom command:
await viewer.executeCommand(new CustomOpacityCommand(0.2))
// Undo to previous state:
await viewer.undo();
// Redo to next state:
await viewer.redo();
npm install @grapecity/gcimageviewer
The following viewer distribution files are located in the zip archive:
build/README.md
(this file)build/CHANGELOG.md
build/index.html
build/gcimageviewer.js
build/plugins/
(optional) Pluginsbuild/themes/
(optional) Theme filesbuild/typings/
(optional) Type definitionsCopy those files to an appropriate location accessible from the web page where the viewer will live, e.g. if the files are put in the directory where the web page is, the following HTML can be used to show the viewer:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="theme-color" content="#000000" />
<title>GrapeCity Documents Image Viewer Demo</title>
<script src="gcimageviewer.js"></script>
<script src="plugins/rotation.js"></script>
<script>
function loadImageViewer(selector) {
var viewer = new GcImageViewer(selector);
viewer.addPlugin(new RotationPlugin());
}
</script>
</head>
<body onload="loadImageViewer('#root')">
<div id="root"></div>
</body>
</html>
The End.
FAQs
Document Solutions Image Viewer
The npm package @grapecity/gcimageviewer receives a total of 18 weekly downloads. As such, @grapecity/gcimageviewer popularity was classified as not popular.
We found that @grapecity/gcimageviewer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.