Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Reply
 
Thread Tools Display Modes
  #1  
Old 09-03-2017, 09:37 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 394
Gender: Unknown/Other
Credits: 14,807
Dinocanid is on a distinguished road
Default Unable to read file? (Imagick issue)

I heard that Mysidiahost allowed Imagick, so I decided to upload my site so I could work on online features. The only problem is that I get a nasty "failed to read file" error when I try. I also get this:
Quote:
trict Standards: Only variables should be passed by reference in /home/wildsoul/public_html/wolfimage.php on line 10
I usually don't worry about strict standards and make them invisible, but doing that this time doesn't solve anything. This is the code in question:
PHP Code:
<?php
class WolfimageController extends AppController{
    
//error_reporting(E_ALL & ~E_STRICT & ~E_NOTICE);
    
public function index(){
// Lets setup the database.
$mysidia Registry::get("mysidia");

//A not-so-clean way to get the wid of the parent page
$fullurl $_SERVER['HTTP_REFERER'];
$cleanwid  end(explode('/',trim($fullurl,'/')));

$pet $mysidia->db->select("wolves", array(), "wid='$cleanwid'")->fetchObject();

// Remember to order these in reverse, the last element in the array should always be the top layer you will see (usually lineart). All images should be the same dimensions. The first element in the array is [0], not [1]!!!!
$images = array(
    
'http://wild-souls.mysidiahost.com/picuploads/den.png',
    
"http://wild-souls.mysidiahost.com/picuploads/wolf_images/pup/bases/" $pet->base " base-pup.png",
    
'http://wild-souls.mysidiahost.com/picuploads/wolf_images/pup/markings/' $pet->marking1 '-pup.png',
    
'http://wild-souls.mysidiahost.com/picuploads/wolf_images/pup/eyes/eyes ' $pet->eyes '-pup.png',
    
'http://wild-souls.mysidiahost.com/picuploads/wolf_images/pup/shade-pup.png',
    
'http://wild-souls.mysidiahost.com/picuploads/wolf_images/pup/lineart-pup.png'
);

// This creates the Imagick class that we will use.
$composed_image = new \Imagick($images);

// Base
$composed_image->setIteratorIndex(2);
$composed_image->compositeImage( new \Imagick($images[1]), \Imagick::COMPOSITE_DSTIN0);
$composed_image->setIteratorIndex(4);
$composed_image->compositeImage( new \Imagick($images[1]), \Imagick::COMPOSITE_DSTIN0);

// As you see above, by calling setIteratorIndex(), you switch your "working layer" to the layer you wish to modify.
// Now lets flatten it and display it. This creates a new Imagick instance to work with with only one flat image.
$image $composed_image->mergeImageLayers(\Imagick::LAYERMETHOD_FLATTEN);
$image->setImageFormat('png');

header('Content-type: image/png');
echo 
$image->getImageBlob();
    }
}
?>
I have to use the full URL since the Imagick version seems to have issues with relative paths. I had to install the plugin myself during local testing, so I'm not sure if mysidiahost calls imagick differently.
__________________
Reply With Quote
  #2  
Old 09-18-2017, 09:42 AM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 394
Gender: Unknown/Other
Credits: 14,807
Dinocanid is on a distinguished road
Default

Any progress on this? My site relies heavily on it.
__________________
Reply With Quote
  #3  
Old 09-23-2017, 03:23 PM
Kesstryl's Avatar
Kesstryl Kesstryl is offline
Member
 
Join Date: Feb 2012
Posts: 119
Gender: Female
Credits: 4,790
Kesstryl is on a distinguished road
Default

Do you think putting the file paths into a variable might help with the problem? Try googling the error you get, that's how I find ways to solve errors. For example, when I google your error, I got this page which may or may not help your problem: https://stackoverflow.com/questions/...eference-error
Reply With Quote
  #4  
Old 09-23-2017, 03:29 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 394
Gender: Unknown/Other
Credits: 14,807
Dinocanid is on a distinguished road
Default

After reading through it, I'm not entirely sure what the answer is saying to do. So I would break this line (line 10):
PHP Code:
$cleanwid  end(explode('/',trim($fullurl,'/'))); 
Into more variables?

EDIT: Nevermind, I got rid of the strict standard error by doing this:
PHP Code:
//A not-so-clean way to get the wid of the parent page
$fullurl $_SERVER['HTTP_REFERER'];
$scrub explode('/',trim($fullurl,'/'));
$cleanwid  end($scrub); 
It still doesn't fix the "failed to read file" issue though. I already contacted HoF about it, and he said it might be an issue with the server and not imagick (which is beyond my control). He's looking into it.
__________________

Last edited by Dinocanid; 09-23-2017 at 03:37 PM.
Reply With Quote
  #5  
Old 09-25-2017, 11:26 AM
Silver_Brick Silver_Brick is offline
Designer || Coder
 
Join Date: Oct 2016
Location: In Earth
Posts: 202
Gender: Male
Credits: 6,460
Silver_Brick is on a distinguished road
Default

hey dude remove this -
Quote:
//error_reporting(E_ALL & ~E_STRICT & ~E_NOTICE);
this is the issue and i am damn sure it will help you out
__________________
Reply With Quote
  #6  
Old 09-25-2017, 12:42 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 394
Gender: Unknown/Other
Credits: 14,807
Dinocanid is on a distinguished road
Default

That's not the problem, since it was commented out (so the file would ignore it anyway). I removed it after I fixed the strict standard, and nothing changed.
__________________
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 08:56 AM.

Currently Active Users: 183 (1 members and 182 guests)
Threads: 3,901, Posts: 31,034, Members: 15,454
Welcome to our newest members, jssknghts01.
BER





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636