Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions vision/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
"src/detect_safe_search_gcs.php",
"src/detect_image_property.php",
"src/detect_image_property_gcs.php",
"src/detect_crop_hints.php",
"src/detect_crop_hints_gcs.php",
"src/detect_document_text.php",
"src/detect_document_text_gcs.php",
"src/detect_web.php",
Expand Down
53 changes: 0 additions & 53 deletions vision/src/detect_crop_hints.php

This file was deleted.

52 changes: 0 additions & 52 deletions vision/src/detect_crop_hints_gcs.php

This file was deleted.

23 changes: 0 additions & 23 deletions vision/test/visionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,29 +245,6 @@ public function testImagePropertyCommandGcs()
}

# tests for Vision 1.1 features
public function testCropHintsCommand()
{
$path = __DIR__ . '/data/wakeupcat.jpg';
$output = $this->runCommand('crop-hints', ['path' => $path]);
$this->assertStringContainsString('Crop hints:', $output);
$this->assertStringContainsString('(210,0)', $output);
$this->assertStringContainsString('(476,0)', $output);
$this->assertStringContainsString('(476,475)', $output);
$this->assertStringContainsString('(210,475)', $output);
}

public function testCropHintsCommandGcs()
{
$bucketName = $this->requireEnv('GOOGLE_STORAGE_BUCKET');

$path = 'gs://' . $bucketName . '/vision/wakeupcat.jpg';
$output = $this->runCommand('crop-hints', ['path' => $path]);
$this->assertStringContainsString('Crop hints:', $output);
$this->assertStringContainsString('(210,0)', $output);
$this->assertStringContainsString('(476,0)', $output);
$this->assertStringContainsString('(476,475)', $output);
$this->assertStringContainsString('(210,475)', $output);
}

public function testDocumentTextCommand()
{
Expand Down
23 changes: 0 additions & 23 deletions vision/vision.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,29 +193,6 @@
})
);

// detect crop hints command
$application->add((new Command('crop-hints'))
->setDefinition($inputDefinition)
->setDescription('Detect crop hints in an image using '
. 'Google Cloud Vision API')
->setHelp(<<<EOF
The <info>%command.name%</info> command prints crop hints for an image using
the Google Cloud Vision API.

<info>php %command.full_name% path/to/image.png</info>

EOF
)
->setCode(function ($input, $output) {
$path = $input->getArgument('path');
if (preg_match('/^gs:\/\/([a-z0-9\._\-]+)\/(\S+)$/', $path)) {
detect_crop_hints_gcs($path);
} else {
detect_crop_hints($path);
}
})
);

// detect document text command
$application->add((new Command('document-text'))
->setDefinition($inputDefinition)
Expand Down