Skip to content

Commit

Permalink
first windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
ksharindam committed Dec 1, 2019
1 parent 450193d commit 39264e5
Show file tree
Hide file tree
Showing 9 changed files with 673 additions and 9 deletions.
File renamed without changes.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# QmageView
# QmageView (for Linux and Windows)
A simple image viewer with some useful features (written in qt4).

### Description
Expand All @@ -21,7 +21,7 @@ This program is aimed at ease of use, quick opening, and doing most necessary fe

This image viewer is tested on Raspberry Pi (Raspbian).

### Build
### Build (Linux)
Install dependencies...
**Build dependencies ...**
* libqt4-dev
Expand All @@ -46,6 +46,15 @@ To uninstall, run ...
* libqt4-svg (optional for svg support)
* libgomp1

### Build (Windows)
Download Qt 4.8.7 and minGW32
add Qt/4.8.7/bin directory and mingw32/bin directory in PATH environment variable.
In qmageview/src directory open Command Line.
Run command...
`qmake`
`make -j4`

You can download the precompiled windows exe package in the [release page](https://github.com/ksharindam/qmageview/releases).

### Usage
To run this program...
Expand Down
3 changes: 2 additions & 1 deletion src/filters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,8 @@ void convolve(QImage &img, float kernel[], int width/*of kernel*/)
int tmp_w = tmp.width();

/* Build normalized kernel */
float normal_kernel[width][width] = {};
float normal_kernel[width][width]; // = {}; // Throws error in C99 compiler
memset(normal_kernel, 0, (width*width) * sizeof(float));

float normalize = 0.0;
for (int i=0; i < (width*width); i++)
Expand Down
4 changes: 4 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ void
Window:: createPhotoGrid()
{
GridDialog *dialog = new GridDialog(canvas->image, this);
int dialog_h = screen_height - offset_y - offset_x;
dialog->resize(1020, dialog_h);
if (dialog->exec() == 1) {
canvas->scale = fitToScreenScale(dialog->gridPaper->photo_grid);
canvas->setImage(dialog->gridPaper->photo_grid);
Expand All @@ -271,6 +273,8 @@ void
Window:: createPhotoCollage()
{
CollageDialog *dialog = new CollageDialog(this);
int dialog_h = screen_height - offset_y - offset_x;
dialog->resize(1050, dialog_h);
CollageItem *item = new CollageItem(canvas->image);
dialog->collagePaper->addItem(item);
if (dialog->exec() == 1) {
Expand Down
2 changes: 0 additions & 2 deletions src/photogrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
GridDialog:: GridDialog(QImage img, QWidget *parent) : QDialog(parent)
{
setupUi(this);
resize(1020, 640);
QHBoxLayout *layout = new QHBoxLayout(scrollAreaWidgetContents);
layout->setContentsMargins(0, 0, 0, 0);
gridPaper = new GridPaper(this);
Expand Down Expand Up @@ -308,7 +307,6 @@ GridSetupDialog:: accept()
CollageDialog:: CollageDialog(QWidget *parent) : QDialog(parent)
{
setupUi(this);
resize(1050, 716);
QHBoxLayout *layout = new QHBoxLayout(scrollAreaWidgetContents);
layout->setContentsMargins(0, 0, 0, 0);
QSettings settings;
Expand Down
10 changes: 6 additions & 4 deletions src/qmageview.pro
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ TEMPLATE = app
TARGET = qmageview
DEPENDPATH += .
INCLUDEPATH += .
QMAKE_CXXFLAGS = -fopenmp
QMAKE_CXXFLAGS = -fopenmp -std=c++11
LIBS += -lgomp

#CONFIG += debug
CONFIG -= debug

# build dir
MOC_DIR = build
Expand All @@ -26,6 +26,8 @@ FORMS += mainwindow.ui resize_dialog.ui photogrid_dialog.ui gridsetup_dialog.ui
collage_dialog.ui collagesetup_dialog.ui

# install
INSTALLS += target
target.path = /usr/local/bin
!win32 {
INSTALLS += target
target.path = /usr/local/bin
}

Loading

0 comments on commit 39264e5

Please sign in to comment.