Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

writing exif data does not work #16

Open
hostingnuggets opened this issue Jun 3, 2014 · 6 comments
Open

writing exif data does not work #16

hostingnuggets opened this issue Jun 3, 2014 · 6 comments

Comments

@hostingnuggets
Copy link

I am trying to add a copyright notice to photos using your package but unfortunately it does not seem to work, when running the "exif" command on the processed image file I get:

Corrupt data
The data provided does not follow the specification.
ExifLoader: The data supplied does not seem to contain EXIF data.

If I open the JPG image in GIMP it doesn't show many anything under the copyright tab of the image properties.

I use the following code which is pretty much the same as in your README:

            $logger = new Logger('exiftool');
            $Writer = Writer::create($logger);
            $bag = new MetadataBag();
            $bag->add(new Metadata(new CopyrightNotice(), new Mono('Test copyright notice')));
            $Writer->write($filteredFilename, $bag);

and use v0.3 of the package. Any ideas?

@romainneutron
Copy link
Owner

please provide a namespaced snippet.
Can you provide the output of the logs ?

@hostingnuggets
Copy link
Author

here would be the relevant namespace:

use Monolog\Logger;
use PHPExiftool\Writer;
use PHPExiftool\Driver\Metadata\Metadata;
use PHPExiftool\Driver\Metadata\MetadataBag;
use PHPExiftool\Driver\Tag\IPTC\CopyrightNotice;
use PHPExiftool\Driver\Value\Mono;

but I can't find any output regarding this pacakge in my log file, I am using symfony 2.5.0 and the app/logs/dev.log file does not contain anything about phpexiftool. or is there another log I am missing?

@quackpack
Copy link

I have problems with Writing as well, used the example in readme file, same as hostingnuggets posted in his post.

I get a white screen of death, no error in any logs what I can find.

Read EXIF data works just fine, but then trying to create the Write object ($Writer = Writer::create();) the return will be white page of death.

@romainneutron
Copy link
Owner

Hello guys,

Please provide complete snippets of code, I can't do anything with pieces that I should assemble myself.

@quackpack
Copy link

Here is the code im trying to run:

  require __DIR__ . '/vendor/autoload.php';

  use PHPExiftool\Writer;
  use PHPExiftool\Driver\Metadata;
  use PHPExiftool\Driver\MetadataBag;
  use PHPExiftool\Driver\Tag\IPTC\ObjectName;
  use PHPExiftool\Driver\Value\Mono;

  $Writer = Writer::create();

  $bag = new MetadataBag();
  $bag->add(new Metadata(new ObjectName(), new Mono('Pretty cool subject')));

  $Writer->write('test.gif', $bag);

@antennaio
Copy link

This should work:

require __DIR__ . '/vendor/autoload.php';

use Monolog\Logger;
use PHPExiftool\Writer;
use PHPExiftool\Driver\Metadata\Metadata;
use PHPExiftool\Driver\Metadata\MetadataBag;
use PHPExiftool\Driver\Tag\IPTC\ObjectName;
use PHPExiftool\Driver\Value\Mono;

$Writer = Writer::create(new Logger('exiftool'));

$bag = new MetadataBag();
$bag->add(new Metadata(new ObjectName(), new Mono('Pretty cool subject')));

$Writer->write('test.gif', $bag);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants