Comments (10)
@xleliberty How do you set the image or how does your code look like?
from media-bundle.
HiThere is no extra code ...
I only use the défaut imagineBlock form...
Xavier Lembo
On Sat, Jul 19, 2014 at 9:33 PM, hacfi [email protected] wrote:
@xleliberty How do you set the image or how does your code look like?
Reply to this email directly or view it on GitHub:
#109 (comment)
from media-bundle.
bizar. are you using fixtures code or an upload? to debug, i would hack into the imagine block code to save a copy of the image to the file system to see if the data is already bad at that point. to narrow down at which point things go wrong...
from media-bundle.
Hi,
thanks for you advice.
I'm currently debugging , i hope i'll find something.
Xavier
from media-bundle.
I've still no luck with this problem...
i've tried debugging but problem seems to be at flush time.
if i dump image just before flushing the complete block (Sonata\DoctrinePHPCRAdminBundle\Model\ModelManager::create ) , the file is ok.
After, it's not...
i've checked again all vendor versions, and packages that matter ( phpcr stuff, jackalope, doctrine/phpcr-odm ) are same on the 2 projects ( symfony-cmf / my project )
Really no idea...
from media-bundle.
Well, the problem lies in doctrine/postgresql/bytea relations...
i've just change the database type of my symfony-cmf from sqlite to postgresql and then, same problem...
Things are not related to MediaBundle... i still investigate.
Xavier
from media-bundle.
uh, interesting. if you change your project to mysql / sqlite, does the problem go away? you could configure a separate dbal connection for jackalope if you use postgres for other things too. (not proposing this as a solution, just to narrow this down).
we seem to have a bunch of tests around binaries in phpcr-api-tests: https://github.com/phpcr/phpcr-api-tests/blob/master/tests/10_Writing/SetPropertyTypesTest.php#L49
but i notice that we set textual data as binary stream, not "real" binary data. if you can investigate further, one thing could be to checkout the jackalope-doctrine-dbal repository stand alone, configure phpunit.xml to run postgres and run the test suite, which should also run those tests. then you could add one more test in SetPropertyTypesTest with some non-printable binary data. if this fails too, we are pretty sure where the problem lies.
from media-bundle.
Well, i think i've finally isolated the problem.
I work on mac dev machine and use liip/php-osx , i think it's the culprit... it's compiled with an oooold version of libpq
PostgreSQL(libpq) Version 8.2.23
PostgreSQL(libpq) PostgreSQL 8.2.23 on i386-apple-darwin12.5.0, compiled by GCC Apple clang version 4.0 (tags/Apple/clang-421.0.57) (based on LLVM 3.1svn)
It seems that this old libpq version doesn't handle cleanly bytea conversions .
i've just done a quick test that show the problem and a solution.
CREATE TABLE bintest
(
id serial NOT NULL,
data bytea,
CONSTRAINT pkok PRIMARY KEY (id)
)
WITH (
OIDS=FALSE
);
<?php
//DATA insertion
$dbh = new PDO("pgsql:dbname=cmf;host=localhost", 'xav');
$thebytes = file_get_contents('source.jpg');
$sth = $dbh->prepare("INSERT INTO bintest ( data ) VALUES (:content)");
$sth->bindParam(':content', $thebytes, PDO::PARAM_LOB);
$sth->execute();
//DATA Reading
//If we use this line, everything is ok
$dbh->query("SET bytea_output=escape");
$sth = $dbh->prepare("SELECT data FROM bintest WHERE id = 1");
$sth->execute();
$content = $sth->fetchColumn();
file_put_contents('test.jpg', $content);
I'm currently reinstalling php from homebrew to verify that, i'll let you know.
Xavier
from media-bundle.
Ok, the end...
i confirm that in my case the culprit is liip/php-osx ...
i've just test again with php compiled with latest libpq and everything is fine.
Sorry for this noise, i close this.
Xavier
from media-bundle.
glad you found the issue. i see you created liip/php-osx#123 - i hope somebody here at liip can address this. (i am working on linux and never touch macs when i can avoid it :-)
from media-bundle.
Related Issues (20)
- use MediaBundle twig functions HOT 1
- Changing Media entity twice in same request is trying to delete directory HOT 5
- Can we use S3DataStore with Jackrabbit implementation for media bundle? HOT 1
- FileController can't handle file name with Chinese character HOT 3
- Symfony 3.x compatibility HOT 2
- Could not load type "cmf_media_image" HOT 2
- unimplemented getParent method HOT 1
- the future of this bundle
- Add new File structure HOT 1
- Hierarchy vs. Hierarchy HOT 1
- Configuration Issue: "There is no extension able to load the configuration for cmf_media" HOT 4
- Integration with Entities: Project Example
- PHP Fatal error Symfony\Cmf\Bundle\MediaBundle\Doctrine\Phpcr\Directory HOT 1
- Unknown "cmf_media_display_url" function. HOT 2
- ChildrenCollection of medea files fails HOT 1
- Fix SonataMedia integration
- Do not use deprecated method HOT 1
- Automaticially add parent document for collection fresh collection items
- Symfony\Cmf\Bundle\MediaBundle\Adapter\ElFinder\PhpcrDriver::$options must be protected or weaker HOT 4
- Attempted to load class "ElFinderVolumeDriver" from namespace "FM\ElFinderPHP\Driver" HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from media-bundle.