Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

ofImage max image resolution

$
0
0

@pablo_paris wrote:

Hello all,

I'm having trouble finding information about the maximum resolution for an image loaded into an ofImage object.

What I want to do is a large panoramic image I can scroll through and that loops to its other side when reaching one bound. Ideally it size would be 8000x1080.
My program is functional, but I get problems when I go above 3000 pixels wide (the jpeg comes out of Gimp with default settings). From 3000 to 4000 it will randomly work or not, and above 4000 it never works. It seems to me its not such a huge resolution, but the program either does not load the image, or crashes with the following output :

 Failed to open BO for returned DRI2 buffer (1280x800, dri2 back buffer, named 21).
This is likely a bug in the X Server that will lead to a crash soon.
Segmentation fault
/home/pcavero/openFrameworks/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:176: recipe for target 'RunRelease' failed
make: *** [RunRelease] Error 139

This my ofApp.cpp :

#include "ofApp.h"

void ofApp::setup(){
//loading and resizing image proportionally to fit screen
image.load("images/image.jpg");
screenwidth = ofGetWidth();
screenheight = ofGetHeight();
newimagewidth = (screenheight*image.getWidth())/image.getHeight();
image.resize(newimagewidth,screenheight);
cout << "image rezided" << endl;
// starts with image aligned on the right limit of the screen
positionx = screenwidth-newimagewidth;
}

void ofApp::update(){
//action when image goes out of bound (this loops it)
if (positionx>0){ positionx = screenwidth-newimagewidth; }
if (positionx<screenwidth-newimagewidth){ positionx=0; }
}

void ofApp::draw(){
//draws the image
image.draw(positionx,0);
}

void ofApp::keyPressed(int key){
//side arrows move the image
if (key == OF_KEY_RIGHT) { positionx +=10; cout << "right" << endl; }
if (key == OF_KEY_LEFT){ positionx -=10; cout << "left" << endl; }
}

Do I have to make tiles for those type of resolution ?

Thank you very much for your time
Pablo

Posts: 5

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4929